Place The Order
Part of the Introduction to SwiftUI section of Coddy's Swift journey. Lesson 47 of 50.
Challenge
MediumKeep everything from the previous steps. Finish OrderView with a Place order button below the total, in the .borderedProminent style. Tapping it shows an alert titled Order placed! with an OK button and the message Total: $4.25 (the order's total, two decimals). Use a @State ordered that starts as false.
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