Recap - Order Form
Part of the Introduction to SwiftUI section of Coddy's Swift journey. Lesson 28 of 50.
Challenge
MediumBuild a coffee order form in a VStack:
- a
TextFieldwith the placeholderNameand the identifiername, bound toname - a
SteppertitledCoffees: 1, ... from1to3, bound tocount, with the identifiercount - a
ToggletitledExtra shot, bound toextraShot, with the identifierextra - a summary text with the identifier
summary, for exampleAda: 2 coffees, with, extra shotadded at the end while the toggle is on
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