Small typo in Section 1.2: Saving a Sample Data Set

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.

Thanks for this. I’ve fixed it in the online reader version.

1 Like

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:

Thank you. I really appreciate you taking the time to report these typos.

This one is now fixed in the online version.

Should I report other small typos here or would you prefer a separate post for each?

Just add them here please.

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.
1 Like

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-click Table 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:

let titleFrame = NSRect(x: 40, y: 20, width: 220, height: 16)
-titleLabel = NSTextField(frame: titleFrame)

let infoProgressFrame = 
  NSRect(x: 40, y: 4, width: 220, height: 14)
-infoLabel = NSTextField(frame: infoProgressFrame)

1 Like

Yes, this shortcut isn’t working for me either. I wonder was it in an earlier version of macOS?

I’ve added a note to this section, explaining this.

The file names are in bold when you have to open them, but in this case you’ve already opened it.

1 Like

Thanks for these. I’ve removed the duplicate lines in the text and in the same apps.

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.

Yes, I noticed that change in the latest Xcode release too. I’ve updated that in this chapter and also in chapter 13.

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:

https://nilcoalescing.com/blog/ReadingTheCurrentWindowInANewSwiftUILifecycleApp/