Hi All - enjoyed going through the book. Found a fair few errors / things that IMO should have been updated for the v1 release to maintain RW standard. Feels like this release was slightly rushed and amazed so many issues got passed the editors.
Page 20
SwiftUI surely follow the same path
SwiftUI will surely follow the same path
Page 25
#if DEBUG
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
} #endif
struct ContentView_Previews : PreviewProvider {
static var previews: some View {
ContentView()
}
}
Page 27
Xcode 11 beta
Xcode 11
Page 27
Picture needs to be updated to not have #if DEBUG statement
Page 34
Scroll down to the DEBUG block - DEBUG is no longer needed
Page 39
Top Picture has #if DEBUG
Page 40 - Note - Xcode 11 is no longer beta
P 62
@Binding var is a reference to the data, so it doesn’t need initialization
@Binding var is a reference to the data, so it doesn’t need a default value
Part of me thinks this should say default value instead. It still needs to be initialised in the struct init
P77
Below the import SwiftUI statement, import UIKit
No need to import UIKit as SwiftUI imports it
p80
view.value = Float(self.value)
uiView.value = Float(self.value)
self.value.value = Double(sender.value)
self.value.wrappedValue = Double(sender.value)
P81
so value.value
so value.wrappedValue
P117 - p118
The same image is used twice. Should only be shown once.
P126
but you’ll go into scaling more in- depth in in the next chapter as well as in Chapter 16, “Expanding the UI”
There is no chapter 16 or a chapter called Expanding the UI
P127
The text for .border image
.border(Color.gray, width: 1, cornerRadius: size / 2)
.border(Color.gray, width: 1)
P137
This is a huge help to people who eyesight issues or visual impairments.
This is a huge help to people with eyesight issues or visual impairments.
You’ll learn more about fonts and accessibility in Chapter 16, “Expanding the UI”
There is no chapter 16 or a chapter called Expanding the UI
P142
If you need a fresh project to continue, locate the starter project for this chapter and open it up.
Locate the starter project for this chapter and open it up.
In chapter 6 - there is no registerView and so a user will need to use the starter project
P154
You’ll begin with your SceneDelegate .swift*
You’ll begin with your SceneDelegate .swift
P155
After changing the practiceStore PropertyWrapper in ChallengeView from an @EnvironmentObject to an @ObservedObject the init for ChallengeView in PractiveView and in ChallengeView_Previews needs to be updated. Probably worth mentioning to reader.
P161
This is a pattern that’s used frequently and often recommended Apple , .
This is a pattern that’s used frequently and often recommended by Apple
P164
VStack(content: {
WelcomeMessageView()
})
VStack {
WelcomeMessageView()
}
p166
@State var name: String = “”
@State private var name: String = “”
P189
Text("\(slider)")
Text("\(amount)")
P191
Refactoring and reusing views are two important aspects that should never be neglected nr forgotten
Refactoring and reusing views are two important aspects that should never be neglected or forgotten
P200
The differences between this and the the case of views with a single child that you’ve seen in the previous section are highlighted in bold text
The differences between this and the case of views with a single child that you’ve seen in the previous section are highlighted in bold text
P219
@State var showAnswers = false
@State private var showAnswers = false
P219
For this to work, you also need a custom initializer to pass in the challenge test and assign it to the property.
This initializer is provided by default from the ChallengeView struct
P220
self.showAnswers = !self.showAnswers
self.showAnswers.toggle()
P224
Why are FlightHistory
and FlightInformation
subclasses of NSObject ??
class FlightInformation: NSObject {}
class FlightHistory: NSObject {}
final class FlightInformation { }
final class FlightHistory { }
P235
ScrollView {
VStack {
Text("\(fl.airline) \(fl.number)")
Text("\(fl.flightStatus) at \(fl.currentTimeString)")
Text("At gate \(fl.gate)")
}
}
ScrollView {
ForEach(flightData) { flight in
VStack {
Text("\(flight.airline) \(flight.number)")
Text("\(flight.flightStatus) at \(flight.currentTimeString)")
Text("At gate \(flight.gate)")
}
}
}
P238
You now need to set the title for this view in the view stack.
You now need to set the title for this view in the view stack and delete the Text View at the top of the VStack.
P242
.navigationBarItems(trailing:
Toggle(isOn: $hideCancelled, label: {
Text("Hide Canceled")
})
)
.navigationBarItems(trailing:
Toggle(isOn: $hideCancelled, label: {
Text("Hide Cancelled")
})
)
P251
Image at bottom is missing the destructive reschedule now option in the action sheet
P259
They should be near line 125
They should be near line 118
P267
You’ll learn more about accessibility in Chapter 15, “Expanding the UI.”
Chapter 15 is not called Expanding the UI
P273
Chapter 16, " Expanding the UI "
There is no chapter 16 or a chapter called Expanding the UI
P278
No mention about opening the new starter project
P281
var id = UUID()
let id = UUID()
P282
You created a deck previously for the Practice feature of the app as a simple array of cards, but the Learn feature has different needs so you’re going to be more explicit with the how the deck words this time.
You created a deck previously for the Practice feature of the app as a simple array of cards, but the Learn feature has different needs so you’re going to be more explicit with the how the deck works this time.
I do not remember ever creating a deck as a practice feature earlier on.
P291
self.revealed = !self.revealed
self.revealed.toggle()
P294
Essentiallym this means the component would move right and up on the screen to match the motion of the users finger
Essentially this means the component would move right and up on the screen to match the motion of the users finger
p296
@GestureState var isLongPressed = false
@GestureState private var isLongPressed = false
P313
Open AirportAwards.swift and add the following code below the first award and above the spacer
There has been no Spacer added to AirportAwards