Group Group Group Group Group Group Group Group Group

Errata for Expert Swift 1st Edition

Creating this topic to catch any typos and bugs in the 1st Edition of Expert Swift.

The title is sadly a copy of the original Advanced Swift book: Advanced Swift · objc.io

Did you really not come up with another name?
For me it‘s a really bad impudence.

Hi…
Maybe this is the wrong forum (if so I apologize) I was wondering about the structure for the insert in chapter 2: Types & Mutation/Quad tree/Copying - the implementation of the insert method.
Isn’t it better to immideately check if the point exists in the region ”before” dive into the children and call insert on them… isn’t that the point of the childrens, that they exist in the same region as the parent… or am I missing something fundamental here?

1 Like

Thanks for the message, @chbeer! It’s fairly common for books to have the same title, but you are right, and we changed ours to promote the long-term health and easy searchability of both books. We call ours Expert Swift. Sorry for the last-minute refactor. :sweat_smile:

On second thought, after looking at the code, I think you are right. Although the code as-is, is not incorrect, you can save a lot of tree traversals by checking earlier as you suggest. Just move the guard region.contains(point) up to the top of the method. Cool.

I will update the download materials and online version to reflect that change. (There are other ways this type could be made faster such as using non-allocating storage for the points. There has been some discussion, and even a prototype for non-allocating fixed size arrays. Maybe we will see that in the Standard Library someday.)

The book is very much an original and an advanced companion to our Swift Apprentice book. When we were alerted that there was a book with the same title, we quickly decided to change the name. Even though there are not a ton of other names to describe an advanced book about Swift, we settled on Expert Swift. You can find that here: Expert Swift | raywenderlich.com

Wow! I‘m really glad you did that! That‘s a really honorable move! :+1::100: Thank you!

1 Like

Awesome :slight_smile: And thanks for a really great book.

1 Like

I read the first chapter and you wrote lots of good material.

I noticed a few typos in the first chapter. I have a couple of other questions which may be errata but deserve separate posts.

Errata: Chapter One

Note: I’m reading the PDF version of the book with Preview. So some of the below issues may be a Preview issue.

  1. This first errata is more of a request: None of the book’s
    subsections appear in the table of contents. So it’s harder to navigate from the table of contents to a specific subsection:
    Screen Shot 2021-05-30 at 23.35.18
  2. When links are over multiple lines, the link is incorrect:
    • On page 36, https://github.com/apple/swift/blob/main/docs/TransparentAttr.md is broken over two lines into https://github.com/apple/swift/blob/main/docs/ and TransparentAttr.md. I can only click the first part and it sends to https://github.com/apple/swift/blob/main/docs/ instead of swift/TransparentAttr.md at main · apple/swift · GitHub
    • On page 38, https://github.com/apple/swift/blob/main/docs/ABI/Mangling.rst is broken into https://github.com/apple/swift/ and blob/main/docs/ABI/Mangling.rst with the same result as above
    • On page 40, http://bit.ly/slava-types is broken into http://bit.ly/ and slava-types with the same result as above.
  3. On page 28 (Section The magic of SIL, subsection Raw SIL), a *magic.rawsil appears.
  4. In the Implementing a language feature section, all of the subsection titles have the same styling as the section titles.
1 Like

Wow. Thanks a lot for this [and your other posts]. (Some of the tooling issues are out of my hands but I will be sure to raise them on the appropriate channels.)

You’re welcome.

Some of the tooling issues are out of my hands

Which issues are tooling related? I can continue to document them as I read and send you direct messages to reduce noise in this post.

Hi,
Typo.
In chapter 11, Functional Reactive Programming, in the section: Triggering Request
In the second paragraph it says: open ”GuitarViewModel.swift”. I assume that should be ”BuildViewModel.swift”

Errata: Chapter 2

Same note as before

  1. The Modeling with types’s subsections titles visually match section titles.
  2. The incorrect link appears on the permuted congruential generator (https://en.wikipedia.org/wiki/ and Permuted_congruential_generator)

Errata: Chapter 3

  1. Typo (emphasis mine): Static dispatch is used, among other reasons, for global functions and methods declared in structs as well as methods on final classes.
    Fix: Static dispatch is used, among other reasons, for global functions and methods declared in value types as well as methods on final classes.
    Location: Bottom of page 77
  2. Typo: As expected, this outputs “Goodbye”
    Fix: As expected, this outputs “Bye”
    Location: Bottom of page 80
  3. Typo: greet still outputs “Hallo”, but leave is now in English and outputs Goodbye!?
    Fix: greet still outputs “Hallo”, but leave is now in English and outputs Bye!?
    Location: Top of page 81
  4. Not really a Typo: .compactMap { $0.data }
    Fix: .map { $0.data }
    Location: Code block of the Networker class on page 86
    Rationale: $0.data is non-optional
  5. Typo: Asking the delegate to provide information, like UIScrollViewDelegate’s numberOfSections(in:)
    Location: Third list item on page 94
  6. Typo: Broken link for the Understanding Swift Performance WWDC 2016 session (apple.co/ and 3n01j0w)