Menu
Coddy logo textTech

Recap - Order Form

Part of the Introduction to SwiftUI section of Coddy's Swift journey. Lesson 28 of 50.

challenge icon

Challenge

Medium

Build a coffee order form in a VStack:

  • a TextField with the placeholder Name and the identifier name, bound to name
  • a Stepper titled Coffees: 1, ... from 1 to 3, bound to count, with the identifier count
  • a Toggle titled Extra shot, bound to extraShot, with the identifier extra
  • a summary text with the identifier summary, for example Ada: 2 coffees, with , extra shot added 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