In chapter 9, there are two instances of the word âdetractsâ that should instead be âsubtractsâ. For example:
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:
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.
Version: SwiftUI_by_Tutorials_v1.1.0(pdf version) - page # 159. Should Your PracticeView will now be... be Your ChallengeView will now be... or I am missing the point.
Hi Guys,
great work on books they are great. Not sure if anyone caught this bug but in Chapter 12 Kuchi app crashes when you give all answers correctly.
This happens because ForEach the way it was made expects constant data and in this case when all answers are made answer array becomes nil so I made little change and it works now.
extension ChoicesView: View {
var body: some View {
VStack(spacing: 25) {
ForEach(0 ..< self.answers.count, id: \.self) { index in
VStack {
Button(action: {
self.answer(self.answers[index])
}, label: {
Text(self.answers[index])
.font(.title)
})
Divider()
}
}
}
}
}