# Swift Apprentice

**URL:** https://forums.kodeco.com/c/books/swift-apprentice/8.md?page=4

[Latest](https://forums.kodeco.com/latest.md) · [Categories](https://forums.kodeco.com/categories.md) · [Tags](https://forums.kodeco.com/tags.md)

**Page:** 5

---

## [Chapter 14 minichallenge solution?](https://forums.kodeco.com/t/chapter-14-minichallenge-solution/19388)

<div class="topic-metadata">

**Author:** [@tattva20](https://forums.kodeco.com/u/tattva20)\
**Replies:** 2\
**Last updated:** [August 14, 2017, 4:54pm UTC](https://forums.kodeco.com/t/chapter-14-minichallenge-solution/19388 "2017-08-14T16:54:27Z")

</div>

Hello to the forum users this is my first post In chapter 14 there is a Mini-Challenge in page 175, at the very end of it that says: Make both firstName and lastName private as well. Create a way to update the students…

---

## [Swift Apprentice 2.0 - small error in bank account code](https://forums.kodeco.com/t/swift-apprentice-2-0-small-error-in-bank-account-code/20884)

<div class="topic-metadata">

**Author:** [@davidkearns](https://forums.kodeco.com/u/davidkearns)\
**Replies:** 1\
**Last updated:** [August 12, 2017, 9:12pm UTC](https://forums.kodeco.com/t/swift-apprentice-2-0-small-error-in-bank-account-code/20884 "2017-08-12T21:12:05Z")

</div>

In Swift Apprentice 2.0 Chapter 19 page 283 there’s an error in the bank account code (nb. Dollars is a typeAlias of Double): func withdraw(amount: Dollars) { if amount \> balance { balance -= amount } else…

---

## [\[Chp 8\] - Arrays - Isolating and removing a repeated element in an Array](https://forums.kodeco.com/t/chp-8-arrays-isolating-and-removing-a-repeated-element-in-an-array/23627)

<div class="topic-metadata">

**Author:** [@crushbowl](https://forums.kodeco.com/u/crushbowl)\
**Replies:** 5\
**Last updated:** [August 12, 2017, 11:19am UTC](https://forums.kodeco.com/t/chp-8-arrays-isolating-and-removing-a-repeated-element-in-an-array/23627 "2017-08-12T11:19:50Z")

</div>

Question #3. Write a function that removes all occurrences of a given integer from an array of integers. I’m trying to wrap my head around the use of the ’\_item’ parameter - and how it isolates a specific repeating elem…

---

## [Chapter 4 Challenge 10](https://forums.kodeco.com/t/chapter-4-challenge-10/23889)

<div class="topic-metadata">

**Author:** [@elmanniaq](https://forums.kodeco.com/u/elmanniaq)\
**Replies:** 1\
**Last updated:** [August 11, 2017, 5:42pm UTC](https://forums.kodeco.com/t/chapter-4-challenge-10/23889 "2017-08-11T17:42:29Z")

</div>

Hi I have small problem with this challenge. My solution is: let givenNumber = 10 var cube1 = 1 var cube2 = 1 var count = 0 let allCombinations = 36 while (cube1 != 6 || cube2 != 6) { if cube1 + cube2 == …

---

## [Swift Apprentice 2.0 Chapter 11 Structures - Introducing Methods](https://forums.kodeco.com/t/swift-apprentice-2-0-chapter-11-structures-introducing-methods/23399)

<div class="topic-metadata">

**Author:** [@gerrykurtz](https://forums.kodeco.com/u/gerrykurtz)\
**Replies:** 4\
**Last updated:** [August 11, 2017, 11:53am UTC](https://forums.kodeco.com/t/swift-apprentice-2-0-chapter-11-structures-introducing-methods/23399 "2017-08-11T11:53:15Z")

</div>

Hi, I’m having trouble finding my error in the let distanceToStore statement: area.center.x to: area.center.y, throws an error: cannot convert value type ‘(Int, to: Int)’ to expected argument type ‘Location’. As far as …

---

## [Chapter 2 Challenge 11](https://forums.kodeco.com/t/chapter-2-challenge-11/24598)

<div class="topic-metadata">

**Author:** [@nrcapes](https://forums.kodeco.com/u/nrcapes)\
**Replies:** 1\
**Last updated:** [August 11, 2017, 11:15am UTC](https://forums.kodeco.com/t/chapter-2-challenge-11/24598 "2017-08-11T11:15:15Z")

</div>

Looking for code for calculating % of exercises solved. Thanks!

---

## [Chapter 24, Page 362](https://forums.kodeco.com/t/chapter-24-page-362/24963)

<div class="topic-metadata">

**Author:** [@puppet](https://forums.kodeco.com/u/puppet)\
**Replies:** 1\
**Last updated:** [August 10, 2017, 1:34pm UTC](https://forums.kodeco.com/t/chapter-24-page-362/24963 "2017-08-10T13:34:29Z")

</div>

The code below gave me this compile-time error: struct PaintingPlanPrivate { var accent = Color.white var bucket = Bucket2(color: Color.blue) var bucketColor: Color { get { return self.b…

---

## [Checklists Tutorial next step - convert plist data to Core Data?](https://forums.kodeco.com/t/checklists-tutorial-next-step-convert-plist-data-to-core-data/15099)

<div class="topic-metadata">

**Author:** [@nitramluap](https://forums.kodeco.com/u/nitramluap)\
**Replies:** 7\
**Last updated:** [August 10, 2017, 1:24pm UTC](https://forums.kodeco.com/t/checklists-tutorial-next-step-convert-plist-data-to-core-data/15099 "2017-08-10T13:24:45Z")

</div>

Firstly, thank you for the wonderful iOS Apprentice Swift tutorials. I’ve worked my way through Checklists and MyLocations (that was a bit trickier) and I had, after Checklists, created a simple list app (with some smar…

---

## [Swift Apprentice Book vs Videos series](https://forums.kodeco.com/t/swift-apprentice-book-vs-videos-series/27792)

<div class="topic-metadata">

**Author:** [@mikesdev](https://forums.kodeco.com/u/mikesdev)\
**Replies:** 3\
**Last updated:** [August 10, 2017, 1:07pm UTC](https://forums.kodeco.com/t/swift-apprentice-book-vs-videos-series/27792 "2017-08-10T13:07:51Z")

</div>

Hi RW’s, Apologies if I have missed a previous topic. I was wondering is the video tutorial series for Swift as detailed as the Swift Apprentice book? Thanks.

---

## [Chapter 15: Casting](https://forums.kodeco.com/t/chapter-15-casting/26594)

<div class="topic-metadata">

**Author:** [@iosdevelopr](https://forums.kodeco.com/u/iosdevelopr)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 3:56pm UTC](https://forums.kodeco.com/t/chapter-15-casting/26594 "2017-07-17T15:56:57Z")

</div>

I’m having trouble replicating the the results that are supposed to happen on page 216 of the pdf: oboePlayer as Student (oboePlayer as Student).minimumPracticeTime // ERROR: No longer a band member! hallMonitor as? Ban…

---

## [Help: Thinking like a programmer to solve challenges](https://forums.kodeco.com/t/help-thinking-like-a-programmer-to-solve-challenges/27508)

<div class="topic-metadata">

**Author:** [@andrewf09](https://forums.kodeco.com/u/andrewf09)\
**Replies:** 1\
**Last updated:** [July 11, 2017, 10:57am UTC](https://forums.kodeco.com/t/help-thinking-like-a-programmer-to-solve-challenges/27508 "2017-07-11T10:57:20Z")

</div>

I’m having a really hard time trying to solve the last 10 questions challenge in charter 4. So far I understand all the code examples and everything that I’ve read. The problem I’m having is trying to think like a progra…

---

## [Print version of Swift 3 Apprentice?](https://forums.kodeco.com/t/print-version-of-swift-3-apprentice/21929)

<div class="topic-metadata">

**Author:** [@anon49889718](https://forums.kodeco.com/u/anon49889718)\
**Replies:** 1\
**Last updated:** [July 30, 2017, 9:37pm UTC](https://forums.kodeco.com/t/print-version-of-swift-3-apprentice/21929 "2017-07-30T21:37:19Z")

</div>

Hey, I keep reading that Swift 3 Apprentice will soon be available in print but my question is when? Before or after Christmas? Thanks.

---

## [How to buy products from store?](https://forums.kodeco.com/t/how-to-buy-products-from-store/11400)

<div class="topic-metadata">

**Author:** [@amanjuneja](https://forums.kodeco.com/u/amanjuneja)\
**Replies:** 4\
**Last updated:** [July 18, 2017, 12:20pm UTC](https://forums.kodeco.com/t/how-to-buy-products-from-store/11400 "2017-07-18T12:20:48Z")

</div>

How can i buy book from store. when i open store it has list of books. i click on any book to buy, have option to “add to cart” but when i enter cart i can see my selected book but you need to select country. my country …

---

## [Swift Apprentice: Beginning Programming with Swift 2.2](https://forums.kodeco.com/t/swift-apprentice-beginning-programming-with-swift-2-2/14596)

<div class="topic-metadata">

**Author:** [@wes\_b](https://forums.kodeco.com/u/wes_b)\
**Replies:** 2\
**Last updated:** [July 18, 2017, 12:19pm UTC](https://forums.kodeco.com/t/swift-apprentice-beginning-programming-with-swift-2-2/14596 "2017-07-18T12:19:09Z")

</div>

Hello raywenderlich.com Tutorial Team, I have recently purchased, Swift Apprentice: Beginning Programming with Swift 2.2 and must say I am very impressed so far! I have been working through the mini exercises, as well …

---

## [Challenge Solutions](https://forums.kodeco.com/t/challenge-solutions/20279)

<div class="topic-metadata">

**Author:** [@conlyman](https://forums.kodeco.com/u/conlyman)\
**Replies:** 4\
**Last updated:** [July 18, 2017, 10:38am UTC](https://forums.kodeco.com/t/challenge-solutions/20279 "2017-07-18T10:38:57Z")

</div>

Challenge Solutions are where? More specifically Chapter 2, Challenge 7

---

## [Chapter 22, Page 334 eratta](https://forums.kodeco.com/t/chapter-22-page-334-eratta/26137)

<div class="topic-metadata">

**Author:** [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Replies:** 1\
**Last updated:** [July 18, 2017, 10:13am UTC](https://forums.kodeco.com/t/chapter-22-page-334-eratta/26137 "2017-07-18T10:13:54Z")

</div>

At the top of the page we are given the code try! try bakery.orderPastry(item: “Cookie”, amountRequested: 1, flavor: “ChocolateChip”) The second try keyword is redundant and causes an error. The correct syntax should …

---

## [Errata for Swift Apprentice v1.3](https://forums.kodeco.com/t/errata-for-swift-apprentice-v1-3/11916)

<div class="topic-metadata">

**Author:** [@rwenderlich](https://forums.kodeco.com/u/rwenderlich)\
**Replies:** 19\
**Last updated:** [July 18, 2017, 8:41am UTC](https://forums.kodeco.com/t/errata-for-swift-apprentice-v1-3/11916 "2017-07-18T08:41:04Z")

</div>

This topic is for bugs, typos, and other mistakes in Swift Apprentice v1.3.

---

## [Swift Apprentice Purchase = International Transaction Fee?](https://forums.kodeco.com/t/swift-apprentice-purchase-international-transaction-fee/26729)

<div class="topic-metadata">

**Author:** [@geeksweep](https://forums.kodeco.com/u/geeksweep)\
**Replies:** 6\
**Last updated:** [July 17, 2017, 8:47pm UTC](https://forums.kodeco.com/t/swift-apprentice-purchase-international-transaction-fee/26729 "2017-07-17T20:47:37Z")

</div>

I paid for the Swift Apprentice online with my bank mastercard (Bank of America) and on my account I was charged $54.99 for the purchase and then I was charged $1.65 for an ‘internation transaction fee’. That doesnt mak…

---

## [Chapter 23 functional programming use of stringByApplyingTransform](https://forums.kodeco.com/t/chapter-23-functional-programming-use-of-stringbyapplyingtransform/19333)

<div class="topic-metadata">

**Author:** [@scottaw](https://forums.kodeco.com/u/scottaw)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 8:46pm UTC](https://forums.kodeco.com/t/chapter-23-functional-programming-use-of-stringbyapplyingtransform/19333 "2017-07-17T20:46:13Z")

</div>

Just FYI to anyone else doing the Swift Apprentice playground exercises in Xcode 8 beta, Swift 3 apparently has changed something that breaks stringByApplyingTransform because it no longer works. The error is: value of…

---

## [Ch 19 Challenge C errata](https://forums.kodeco.com/t/ch-19-challenge-c-errata/26046)

<div class="topic-metadata">

**Author:** [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 8:34pm UTC](https://forums.kodeco.com/t/ch-19-challenge-c-errata/26046 "2017-07-17T20:34:01Z")

</div>

In Chapter 19’s Challenge C you are asked to create a small game with a battle(\_: GameCharacter, vs: GameCharacter) method. The instructions state that the first character strikes first. However, the solution code provid…

---

## [Ch 21 Challenge D errata](https://forums.kodeco.com/t/ch-21-challenge-d-errata/26099)

<div class="topic-metadata">

**Author:** [@brianlawson](https://forums.kodeco.com/u/brianlawson)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 8:32pm UTC](https://forums.kodeco.com/t/ch-21-challenge-d-errata/26099 "2017-07-17T20:32:47Z")

</div>

The Challenge D solution provided is incorrect. Positive latitudes are in the northern hemisphere. The solution provided prints “In the Northern Hemisphere!” when lat \< 0.

---

## [Errata - Solution for Ch 7: Functions Challenge A](https://forums.kodeco.com/t/errata-solution-for-ch-7-functions-challenge-a/10350)

<div class="topic-metadata">

**Author:** [@mbspears](https://forums.kodeco.com/u/mbspears)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 8:30pm UTC](https://forums.kodeco.com/t/errata-solution-for-ch-7-functions-challenge-a/10350 "2017-07-17T20:30:31Z")

</div>

The solution for Ch 7 Challenge A (Prime Numbers) incorrectly identifies “1” as a prime number. The offending code is: if number \<= 3 { return true } Replacing that code with the following will correct the issue: i…

---

## [Confussion about the tutorial](https://forums.kodeco.com/t/confussion-about-the-tutorial/19826)

<div class="topic-metadata">

**Author:** [@poseidon](https://forums.kodeco.com/u/poseidon)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 8:27pm UTC](https://forums.kodeco.com/t/confussion-about-the-tutorial/19826 "2017-07-17T20:27:16Z")

</div>

y i cant use the instance variable from that class.And one more the search result didnt even show up on table view although i make exactly same as the tutorial given.

---

## [How can I understand this snippet](https://forums.kodeco.com/t/how-can-i-understand-this-snippet/16139)

<div class="topic-metadata">

**Author:** [@nen](https://forums.kodeco.com/u/nen)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 8:21pm UTC](https://forums.kodeco.com/t/how-can-i-understand-this-snippet/16139 "2017-07-17T20:21:43Z")

</div>

In Swift Apprentice , P107(pdf, 4th edition): func addItemViewController(controller: AddItemViewController, didFinishAddingItem item: ChecklistItem) {let newRowIndex = items.count items.append(item) let indexPath = NSIn…

---

## [The non Index in Swift Apprentice](https://forums.kodeco.com/t/the-non-index-in-swift-apprentice/13485)

<div class="topic-metadata">

**Author:** [@riccardo35](https://forums.kodeco.com/u/riccardo35)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 8:10pm UTC](https://forums.kodeco.com/t/the-non-index-in-swift-apprentice/13485 "2017-07-17T20:10:41Z")

</div>

Your Swift Apprentice is built with great attention but is without the Index: an unforgivable fault on your part

---

## [Public Changelog for Swift Apprentice?](https://forums.kodeco.com/t/public-changelog-for-swift-apprentice/12277)

<div class="topic-metadata">

**Author:** [@stemcc](https://forums.kodeco.com/u/stemcc)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 8:08pm UTC](https://forums.kodeco.com/t/public-changelog-for-swift-apprentice/12277 "2017-07-17T20:08:47Z")

</div>

Reading the forums I can tell you keep this book updated. However I was curious if you kept a public changelog? It’s peace of mind when investing in a resource for something that changes so quickly like Swift, to know th…

---

## [iOS Apprentice 5th Edition: Is Update Free?](https://forums.kodeco.com/t/ios-apprentice-5th-edition-is-update-free/19848)

<div class="topic-metadata">

**Author:** [@sisball8](https://forums.kodeco.com/u/sisball8)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 8:05pm UTC](https://forums.kodeco.com/t/ios-apprentice-5th-edition-is-update-free/19848 "2017-07-17T20:05:14Z")

</div>

I’ve been working on the iOS Apprentice 4th Edition books now for the past few months. I updated to the new version of Xcode today and a million errors came up on my projects. There were a lot of name changes in function…

---

## [Challange 1 Chapter 20 - Why type-parameter?](https://forums.kodeco.com/t/challange-1-chapter-20-why-type-parameter/22294)

<div class="topic-metadata">

**Author:** [@xarax](https://forums.kodeco.com/u/xarax)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 6:27pm UTC](https://forums.kodeco.com/t/challange-1-chapter-20-why-type-parameter/22294 "2017-07-17T18:27:06Z")

</div>

Could someone explain why I need the second parameter “type” in the subscript below. I’m sure there’s a perfectly obvious explanation, but I don’t get it… //Why do we need the second parameter type? extension Array { …

---

## [Ch. 9 Dictionaries: Challenges Q. 6 Unable to understand the solution](https://forums.kodeco.com/t/ch-9-dictionaries-challenges-q-6-unable-to-understand-the-solution/24690)

<div class="topic-metadata">

**Author:** [@minesh16](https://forums.kodeco.com/u/minesh16)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 5:42pm UTC](https://forums.kodeco.com/t/ch-9-dictionaries-challenges-q-6-unable-to-understand-the-solution/24690 "2017-07-17T17:42:58Z")

</div>

Hi there, I am very new to programming. I am going through all the chapters and solving all the challenges. I got stuck with Q6 in Dictionaries. I referred to the solution and couldn’t clearly understand the solution.…

---

## [Swift Apprentice Chapter 9 bug?](https://forums.kodeco.com/t/swift-apprentice-chapter-9-bug/24427)

<div class="topic-metadata">

**Author:** [@dpalme](https://forums.kodeco.com/u/dpalme)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 5:18pm UTC](https://forums.kodeco.com/t/swift-apprentice-chapter-9-bug/24427 "2017-07-17T17:18:15Z")

</div>

I started working on Chapter 9 and immediately came across the following: Page 140 its describing printing the value of Anna in the dictionary namesAndScores print(namesAndScores\["Anna"\]) When execute this in the play…

[Previous page](https://forums.kodeco.com/c/books/swift-apprentice/8.md?page=3)

[Next page](https://forums.kodeco.com/c/books/swift-apprentice/8.md?page=5)
