You are right, there should have been an explanation of why the protocol declaration had class there. Will fix in the next update. But that’s not a typo. You can easily verify this by removing the class binding for the protocol and see what happens. And yes, you can use AnyObject instead of class too.
But simplifying by not having the delegate be strong is not the way to go unless you absolutely, definitely, with 100% certainty know that it will not lead to retain cycles.
I just finished this wonderful book, it was a great experience.
Two important issues I wanted to ask/note:
Page 841, But with iOS 11, there’s a new way to do things - your old pal Codable.
→ This should actually be Swift 4, shouldn’t it? I can compile the project to iOS 10 (and with small modification even to iOS 9) and it’ll work. So it’s not dependent on iOS version, I believe.
Page 875, However, till iOS 11, and With iOS 11, Apple introduced → This is actually dependent on Xcode version, not on iOS, namely it got introduced with Xcode 9, didn’t it?
the : after the _ are not in the actual code we are supposed to type in
You don’t type any of it in your program. Rather, that syntax is used when you need to describe a method in some text.
When you need to write about a method in a book or in a post on a forum, you need some way of uniquely identifying the method name. The _: signifies that the method takes an argument without a parameter label. For instance, here are two method definitions:
If you need to write something describing one of those methods, you refer to the first method as go(_:direction:) and the second method as go(time:location:). When you need to call those methods in your code, you do have to write some colons:
it’s very odd seeing functions have different looking notations depending on where they are in the code - not seen that in any other language i’ve ever worked with before
That is incorrect. Methods always use the same syntax in your code. However, Swift is unique among the languages that I’ve studied in that parameter variables are considered part of the method name.
“Now that the table view knows it has one row to display, it calls the second method you added – tableView(_:cellForRowA:t) – to obtain a cell for that row.”
p. 566 “The description cell at the top…” this is not actually shown in the figure.
p.568 The (Message Label) from Ch 23 does not appear in the figure.
p. 569 It might be clearer to say that the Cancel button goes right on top of the “<Back”. I was a bit confused on the “left slot” description.
p. 583 misspelled “knoiw” should be “know”
p. 604 The background color is red, however on p. 606, 607, and 609 it is gone. Either this is intentional so that the HUD is apparent or it was coded out. If the latter, I am not sure where this was done.
The description cell is there but since a text view normally does not show a border (or hint text) you cannot see it as something other than white space in the cell. This is just how iOS works. I believe that we add some text to show the description label and that text is missing here. Is that what you meant?
Page 604 says “Remove the backgroundColor line from the hud(inView:animated:) method.” - that’s where that happened