Errata
The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted by | Date submitted |
---|---|---|---|---|
Chapter 6 - Changing properties using methods | With respect to mutating functions , by way of a NOTE it has been mentioned that: |
pankaj | Oct 06, 2021 | |
Chapter 4. `Functions and Enums: Reusing Code on Demand`, in section `Function types work like every other type` | In chapter 4. `Functions and Enums: Reusing Code on Demand`. |
Anonymous | Jan 13, 2022 | |
Printed | Page Page 130 Center |
I am unable to locate where, in Chapter 4, the answers for the following are found: |
Anonymous | Aug 10, 2022 |
Chapter 11 brain power section Brain power, I don't have a page number. |
You ask folks to draw a triangle, unless I am missing something, there is no triangle shape, perhaps you meant rectangle? |
Anonymous | Dec 23, 2022 | |
ePub | Page chapter 10, your first SwiftUI UI HuzzahView |
The sample code won't compile. Last line needs to be |
Johannes | Dec 24, 2022 |
ePub | Page chapter 10, DrinkCounterView example right after DrinkCounterView example |
After having presented the - not yet working - DrinkCounterView code, you talk about BirdCounterView twice in the text that immediately follows. |
Johannes | Dec 24, 2022 |
Printed | Page 23 Exercise |
The exercise asks the user to modify the ingredients array by appending a value; however, the array was defined as a constant, so this will fail unless the user changes the array to a variable. This should be made more clear. |
James Leno | Jun 18, 2022 |
Printed | Page 23 "Exercise" section |
The Exercise section describes the process to append a new element to the "ingredients" array, using the .append() function. This function isn't applicable to this example, however, as the "ingredients" array is declared as a constant on page 22, using a "let" statement. The .append() function returns an error, due to the immutability of the 'let' constant ingredients. |
Mitchell T Schaff | Jan 17, 2024 |
Printed | Page 57 Last section |
The code creating the dictionary does not match the graphical example. |
James Leno | Jun 29, 2022 |
Printed | Page 80 Middle of page |
\(n) should be \(d) in for loop code |
James Leno | Jun 29, 2022 |
Printed | Page 112 Variadic code shown |
The handwritten result for the line `let a = average(10, 21, 3.2, 16)` is shown as being 16.625, but that is incorrect. The correct average of those numbers is 12.55. |
Steve Graff | Aug 25, 2022 |
Printed | Page 127 Switching with enums |
The code shown at the top of page 127 displays errors, such as "Enum case 'dead' has no associated values" for the playerOneState definition. It relies on the earlier enum definition on page 125, but that appears to be missing the needed associated value definitions. I found that by defining and naming the associated values in the enum that this code compiles and runs fine: |
Steve Graff | Aug 25, 2022 |
Printed | Page 128 Within the Exercise box |
The first paragraph's second sentence is very long and gramatically incorrect. I suspect it's missing some punctuation, presumably a period (.) between the words choice and Once. |
Anonymous | Aug 10, 2022 |
Printed | Page 129 The body of a function |
The code for the function "welcomeCustomers" is missing both the empty parentheses in the definition, and also the closing parentheses at the end of the 'print' line. It should read as: |
Steve Graff | Aug 25, 2022 |
Printed | Page 160 Be the Swift Compiler Solution |
The solution states that H will work. However, H, as written, will not work, because the closure defined in H is named "slicePizza", but the call immediately after the closure definition is to "slicepizza". The variable name is not the same as the closure being called. This will result in a "Cannot find 'slicepizza' in scope" error. |
Mitchell Schaff | Feb 02, 2024 |
Printed | Page 195 "Plant" class initializer |
The initializer for the Plant class, as shown in the book, will not compile, as it does not include the code needed to set the value of the "type" property. As written, the code will generate a "'self.type' not initialized" error. |
Mitchell Schaff | Feb 06, 2024 |
Printed | Page 293 Variable Declarations |
In the "Sharpen your pencil Solution" for the DrinkCounterView, the three variables are defined without the "@State" attribute. This will result in a "Left side of mutating operator isn't mutable: self is immutable" error for each statement that increments the counters. |
Mitchell Schaff | Feb 10, 2024 |
Printed | Page 293 Variable Declarations |
Please ignore my errata suggestion for this page. I hadn't read the notes at the bottom of the solution. |
Mitchell Schaff | Feb 10, 2024 |
ePub | Page 419 Code Magnets Solution |
int redTeamScore: Int { ... |
Anonymous | Jul 05, 2023 |