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?
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.
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: https://www.raywenderlich.com/books/expert-swift/v1.0/
Wow! Iâm really glad you did that! Thatâs a really honorable move! Thank you!
Awesome And thanks for a really great book.
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.
- 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:
- 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 intohttps://github.com/apple/swift/blob/main/docs/
andTransparentAttr.md
. I can only click the first part and it sends to swift/docs at main · apple/swift · GitHub 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 intohttps://github.com/apple/swift/
andblob/main/docs/ABI/Mangling.rst
with the same result as above - On page 40,
http://bit.ly/slava-types
is broken intohttp://bit.ly/
andslava-types
with the same result as above.
- On page 36,
- On page 28 (Section The magic of SIL, subsection Raw SIL), a
*magic.rawsil
appears. - In the Implementing a language feature section, all of the subsection titles have the same styling as the section titles.
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
- The Modeling with typesâs subsections titles visually match section titles.
- The incorrect link appears on the permuted congruential generator (
https://en.wikipedia.org/wiki/
andPermuted_congruential_generator
)
Errata: Chapter 3
-
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 -
Typo: As expected, this outputs âGoodbyeâ
Fix: As expected, this outputs âByeâ
Location: Bottom of page 80 -
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 -
Not really a Typo:
.compactMap { $0.data }
Fix:.map { $0.data }
Location: Code block of theNetworker
class on page 86
Rationale:$0.data
is non-optional -
Typo: Asking the delegate to provide information, like
UIScrollViewDelegate
âsnumberOfSections(in:)
Location: Third list item on page 94 -
Typo: Broken link for the Understanding Swift Performance WWDC 2016 session (
apple.co/
and3n01j0w
)
Maybe this is the wrong forum, but I just want to mention that in Chapter 8: Codable, there is one challenge, I wanted to see if my outcome was correct but couldnât find the challenge solved in the repo, although, there is one folder called Challenge but is empty
@freak4pc @jellodiil Can you please help with this when you get a chance? Thank you - much appreciated! :]
Hey @jairmg, sorry for the delay in the reply!
I might be missing something but the chapter ends with a second on Encoding and then with the chapterâs Key Points. I believe thereâs no challenge for this chapter, unless I missed something.
We do use the terminology, âhereâs the next challengeâ in the chapter but itâs not a challenge per-se, since itâs a regular âby tutorialsâ section where you get all the code to complete the task. Let me know if this is what caused the confusion, perhaps it would be worth rephrasing it.
Seems to me the challenges folder is a mistake here.
Thanks again, and hope youâre enjoying the book!
Thanks @lekrans, thatâs definitely the case. Probably an earlier iteration of that project
Weâll be sure to grab that fix in the next edition.
Thanks again!
Congratulations on a great book. I am currently reading the Chapter 7 âStringsâ and I donât think the âUTF-16 binary representationâ paragraphs are correct. Specifically:
If the 2 bytes start with
0xD8
(110110
in binary), those two bytes complete a character.
Isnât that supposed to be the opposite? Also, it confusingly continues with:
This character is 4 bytes in size.
Hello, Iâve got bunch of errors like this this morning. Is the team aware of it?