Errata: April 14, 2019

Thank you for purchasing Swift in Depth. If you find errors not noted below, you can report them in the LiveBook Errata thread. We'll update this list as necessary.



Page xvii, Acknowledgements:

Please add the following list of reviewers to the end of paragraph four:

Also, I would like to thank the other reviewers: Alessandro Campeis, Ali Naqvi, Axel Roest, David Jacobs, Gustavo Gomes, Helmut Reiterer, Jason Pike, John Montgomery, Kent R. Spillner, Lars Petersen, Marcelo Pires, Marco Giuseppe Salafia, Martin Philp, Monica Guimaraes, Patrick Regan, Tyler Slater, and Weyert de Boer.

In chapter 3, section 3.2.6. page 45

The line .dateComponents([.year], from: Date(), to: birthDate) should be .dateComponents([.year], from: birthDate, to: Date())

In chapter 7, section 7.3.1, page 133, in the note

The note mentions section 4.4, but that should be 7.4.

In chapter 9, Listing 9.41, page 194

The last line in the code should be: let adrenalinePlan: TravelPlan = [adrenalineTrip: activities] // You can now create a TravelPlan from a dictionary.

In chapter 9, page 194, section 9.5.4, listing 9.41

There is a _ character missing in the third line after "first ," The line should be: self.trips = Dictionary(elements, uniquingKeysWith: { (first, _) in

In chapter 10, section 10.1.2

In the "Unique Keys" blurb, the line
For instance, if you pass [(name: "Miranda", count: 30, name: "Miranda", count 40)]
should be
For instance, if you pass [(name: "Miranda", count: 30, (name: "Miranda", count: 40)]
Note how I added both a ( and a :

In chapter 10, section 10.5.2, listing 10.15

The line
You return an optional String
should be
You return an optional URL.

In chapter 10, page 227, answer for question 7

In the code let strideSequence = stride... etc The number 30 should be 100.

Chapter 13, listing 13.9, page 388

API(session: session) should be WeatherAPI(session: session).