Recap - Plant Guide
Part of the Introduction to SwiftUI section of Coddy's Swift journey. Lesson 38 of 50.
Challenge
MediumBuild a plant guide. ContentView shows a NavigationStack (identifier nav) with a List titled Plants, one NavigationLink per plant, titled with its name. Each link opens PlantDetail for its plant, which:
- uses the plant's name as its title
- shows
Water every 7 days(fromwaterDays) in a text with the identifierwater - has a
Wateredbutton that shows an alert titledNice work!with anOKbutton
Try it yourself
import SwiftUI
@main
struct CoddyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}All lessons in Introduction to SwiftUI
Practice on your own: Swift playground