Hi there, hope this is the right category for this…
Went thru the first 8 chapters and they were really great and helpful… Found a bug in chapter 7 that stopped me dead in my tracks and made me go to the Final Code files for the chapter…
On page 281 (reading on iPad Mini - so probably different for you), the book says this:
.onAppear() {
self.startNewGame()
}
.background(Image("Background"))
}
.navigationViewStyle(.stack) /* Problem line */
}
And it didnt work no matter what I tried… So i went to the final code files for chapter 7, and it was actually this:
Once I changed it, everything worked great… It was really nice to have those code files available to compare! But figured I’d let you guys know to possibly fix it in future versions, or help someone new who ran into the same issue…
Theres also another issue with the random # generator where you use from 1 through 100 in multiple places (after the initial 1…100 code), but that one is easy to figure out…
Thanks for the heads-up! Feedback like this is incredibly helpful.
SwiftUI was in a fair bit of flux when I was writing the Bullseye chapters, and a surprising amount of the code got invalidated as each new beta version of Xcode came out. It looks like we missed one of the changes. I’ve made a note of the error in the text, and will see about getting it corrected.
Hey @accordionguy, I get it… Finding a book that’s up to date with the latest version of everything has been hell… This is the first time using a digital book to learn a language, and surprisingly its a lot easier with an iPad than paper! It does give incentive to get through the book quickly before the next version invalidates everything again Honestly, I expected a lot more problems with the new version of Xcode, etc - but the first 8 chapters have been smooth other than the .stack thing… Loving the book so far - been very helpful
the “From 1 through 100” issue with the random # generator and slider happens in multiple places in multiple chapters surrounding other code… I tried typing it in, but it didnt work, so i went back to the 1…100 way which was how it was originally presented…
Gonna add this here and take the "“CH 7” off the title of the thread (if i can) so I don’t have a new thread for every typographical error…
Chapter 10 - p 397 (iPad mini - your page # may be different - but its two pages before the end of Chapter 10)
Found another one that I had to go to the final source code to figure out… It’s simple now that I look at the correct code, but the break between the two equal signs confused the hell out of me… Especially when it was right in the middle of syntax with “$0.id” in it, so it was the wild west in syntax already
Book code:
.onTapGesture {
if let matchingIndex = self.checklistItems.firstIndex(where: { $0.id =
= checklistItem.id }) {
self.checklistItems[matchingIndex].isChecked.toggle()
}
self.printChecklistContents()
}
Correct code from Ch 10 - final source code:
.onTapGesture {
if let matchingIndex =
self.checklistItems.firstIndex(where: { $0.id == checklistItem.id }) {
self.checklistItems[matchingIndex].isChecked.toggle()
}
self.printChecklistContents()
}
}
Don’t worry about being annoying — I’d rather go through a little extra work in order to make the book experience great, get great feedback, and land work on another book (maybe even the 9th edition!).
I want to be clear- I’m enjoying the book. The explanations are at a perfect level for me, a “recurring beginner.” I will also acknowledge that I am a perfectionist, and as such I see every error, typo or otherwise. I have not been flooding this forum with them, because as pointed out, most people probably can figure them out.
Is your stance to just leave them be? Here’s a good example: At the end of Chapter 7 the last code block image is supposed to show the selection of the VStack block. Instead, it shows the finished product, with no overt explanation of how to get there. To fix, you would need to:
change the image to the code showing the VStack block selected
describe the indentation method used previously (Command + ])
direct to add “Group {” above VStack
direct to add “}” in line after .backgroud(beige)
direct to add “.background(Image(“Background”))” after that closing brace
Two paragraphs above this, “…complete with padding:” suggests an image was supposed to follow.
Will there be a future edit? Like @jamesh I will only post if something’s stumped me, but I’m curious how rigorous you plan to edit raywanderlich books.
Hi,
I’m not sure if this a typo or not, but when I changed it, it worked. Right now, on pg. 782, it says:
String(from: placemark)
…but later we make a function called string(from placemark:) on pg. 783.
I went back and changed the capital S in String to a lowercase s since we have a new function for it. It ran successfully. I didn’t see any mention of that in the textbook, but if I misunderstood something, please disregard. Thank you!