Errata for SwiftUI by Tutorials 1st Edition

Thanks Piers, well spotted! I’ve fixed my chapters for the next update :+1:

Fully agreed. My sentiments are very much similar. Feeling confused while reading the chapter 7. The chapter 8 starts with chapter 6 “Finished” . The book needs some thorough review work or udpates in near future .

Hi,

I am going through Chapter 8. It seems the SwiftUI has some changes? I double check by running the final project. Here you can see the ‘remember me’. Even though it is .trailing the UI shows .leading

    Toggle(isOn: $userManager.settings.rememberUser) {
      Text("Remember me")
        .font(.subheadline)
        .multilineTextAlignment(.trailing)
        .foregroundColor(.gray)
    }
  }

55

Nice! As mentioned previously really appreciate RW and the authors of this book. Just want to help maintain RW standard as its the best place to learn iOS IMO and wished I had just known about and used RW and not gone to an expensive coding bootcamp to initially learn iOS.

Look forward to the updated edition.

1 Like

Chapter 3 - iBooks page 48 - embedding the top-level VStack in a NavigationView resulted in the view no longer being displayed in landscape view on an iPhone. For this to work properly, it seems that we need to set the NavigationViewStyle.

var body: some View {
NavigationView {
VStack { … }
}.navigationViewStyle(StackNavigationViewStyle())
}

1 Like

thanks! I noticed this today and I’ll fix it for the next update.

I think the change happened in a later beta…

I actually get better results with:

NavigationView {
  VStack {
     ...
  }
   .navigationBarTitle("", displayMode: .inline)
   .navigationBarHidden( true )
}

It doesn’t seem like you’d need both of these, but it doesn’t work if you comment out one or the other. And the navigation bar doesn’t really go away :frowning:.

Chapter 3 page 72 "“Then remove the padding from the HStack in ColorSlider.swift, so the view looks like this:” Should ColorSlider.swift be listed as ContentView.swift?

hi Kenny! thanks for noticing this — it should be “the ColorSlider view”. I’m not sure how that .swift got in there :confused:

the correction will be in the next update.

Thanks a lot for reporting all these errors. I’ve updated my chapters

1 Like

Thanks for reporting this. The text alignment is actually superfluous here, because the Text is sized to fit its content, so there’s no alignment at all, at least as long as the text is on a single line. I’ve removed that line from both the project and the code snippet in the book.

What changed instead is the behavior of the Spacer() that precedes the Toggle(): it should “push” the toggle, and the text label it contains, to the right, as shown in the corresponding screenshot included in the book - It looks like the spacer behavior has changed with the latest Xcode release (either 11.0 or 11.1), now the spacer has a small fixed width instead.

Thanks for your hard work. Learn’t a lot from your chapters.

1 Like

Minor typo but the title page for the “complex interfaces” chapter says chapter 14, when it should say chapter 15. That also means I’m almost done :wink:

congratulations Darrell!

the chapter title is correct in version 1.0.1

Chapter 2, page 24. Create a new project screenshot: “Use SwiftUI” is no longer a checkbox.

thanks! I’ll fix it for the next update.

Do you know more or less when the next update will be available?

hi Robert! v1.1.0 came out on Nov 14, and it addressed most of the issues raised in this forum. Is there something in particular you want updated?

In chapter 9, there are two instances of the word “detracts” that should instead be “subtracts”. For example:

  1. The container view detracts from the available frame the size chosen by the child view, and goes back to step no. 2, until all children views have been processed.

should instead be:

  1. The container view subtracts from the available frame the size chosen by the child view, and goes back to step no. 2, until all children views have been processed.

This error detracts attention from the otherwise excellent text as I’m distracted by the discrepancy. :wink:

Ahah, changed so that the error now subtracts attention instead of detracting. :]
It’ll be available in the next update
Thanks!

1 Like

On my machine using Xcode 11.2.1, iOS 13.2.2, Chapter 4 RGBullsEye ContentView body
jnjsjmiller suggestion:


    .navigationViewStyle(StackNavigationViewStyle())

worked better than:


    .navigationBarTitle("", displayMode: .inline)
    .navigationBarHidden(true)
1 Like