In Section 1.2, Subsection Working with the File System, there’s a small type about ⌘+0. It won’t necessarily open the project navigator. It will open the project navigator if you closed the left side of Xcode on the project navigator. ⌘+1 will always open the project navigator.
-Note: If you can’t see the files list, press Command-0 to open the Project navigator.
+Note: If you can’t see the files list, press Command-1 to open the Project navigator.
I found another one in Section 1.12 Testing with Live Data:
-First, find getDateForDay(month:day:) and replace its signature line with this one which sets it to return a Day:
+First, find getDataForDay(month:day:) and replace its signature line with this one which sets it to return a Day:
I don’t know if this one classifies as a typo as I couldn’t easily describe the type of links. The type of links is a dictionary with dictionary values (versus dictionary containing arrays of dictionaries). But as we see later in the chapter, it’s an array with weird JSON structure.
Book Text
Section 1.6 Going Deeper:
struct Event: Decodable {
let text: String
let links: [String: [String: String]]
}
For now, links is an ugly dictionary containing arrays of dictionaries, but this is enough to get it decoding.
This is as I intended. It’s a temporary piece of code demonstrating how much better it is to use a custom model instead of keeping the JSON dictionary.
But you are completely correct. It is a dictionary where the keys are strings and the values are dictionaries.
Section 3.7 Using a Picker, subsection Expanding the Menu: The fourth list item
-For each item, use its `rawString` as the title and its actual value as the tag. `displayMode` is set to the tag when the user selects an option.
+For each item, use its `rawValue` as the title and its actual value as the tag. `displayMode` is set to the tag when the user selects an option.
In Section 4.4 Storing Window Settings, Control-Shift-A is not working for me (macOS 12.3.1, Apple M1 Max)
Note: When you quit the app with more than one window open, and then run it again from Xcode, sometimes only one window will come to the front. Click the app in the Dock — or press Control-Shift-A — to bring all its windows into view.
In Section 4.6, Selecting Events, subsection Displaying the Full Event Data, when you Command-click on Table, the option for Embed in HStack will only appear if Xcode has the Canvas option on.
Still in TableView.swift, Command-clickTable and select Embed in HStack. After the Table, just before the closing brace of the HStack, add this conditional code:
This one might not be a typo, but I noticed that all other file name references in chapters are styled bold:
Location: Chapter 7, Section 2, Subsection Setting up the Status Bar Item.
Typo: In the paragraph before the Connecting the menu_ Xcode screenshot, there is AppDelegate.swift that is not bold:
-__Control-drag__ from the Menu under Time-ato to `statusMenu` in AppDelegate.swift.
+__Control-drag__ from the Menu under Time-ato to `statusMenu` in __AppDelegate.swift__.
Location: Section 7.7 (Creating a Custom View), in the second numbered list
Typo: InItialize
-2. InItialize `imageView`, using the `NSRect` as its frame.
+2. Initialize `imageView`, using the `NSRect` as its frame.
Additionally, in the code block following this numbered list, the lines starting titleLabel = and infoLabel = are already provided by the initial TaskView.swift:
In the last paragraph of Section 9.3 (Opening the Sandbox), I don’t see an x anywhere but I see a trash bin icon:
-... by clicking the __X__ at the top right of the __App Sandbox__ settings.
+... by clicking the __🗑__ at the top right of the __App Sandbox__ settings.
In Section 11.7 (Focusing on a Window), the link for Reading from the Window in a SwiftUI lifecycle app 404’s for me. It attempts to go to the following URL, but I couldn’t tell if the article was renamed or not: