Follow along at https://www.hackingwithswift.com/100/swiftui/28.
This day covers Part Three of Project 4: BetterRest
in the 100 Days of SwiftUI Challenge. (Project 4 files can be found in the directory for Part One.)
In addition to recapping the material covered during the project's other days, Day 24 focuses on extending the project according to a set of challenges.
Replace each VStack in our form with a Section, where the text view is the title of the section. Do you prefer this layout or the VStack layout? It’s your app – you choose!
- Already covered in Day 27 🙂.
Regarding preferences, though, Form
gives us built-in scrolling functionality and is more semantically appropriate for what we're building -- so I'd probably lean in that direction.
Replace the “Number of cups” stepper with a
Picker
showing the same range of values.
- 🔗 Commit
Change the user interface so that it always shows their recommended bedtime using a nice and large font. You should be able to remove the “Calculate” button entirely.
- 🔗 Commit