Project Overview
Part of the Introduction to SwiftUI section of Coddy's Swift journey. Lesson 43 of 50.
In this project you build Coddy Coffee, a small ordering app, one step per lesson. By the end it has:
- a menu of drinks with their prices
- a screen for each drink
- a size picker
- a quantity stepper and the order's total
- a button that places the order
Each step starts from your code of the previous step, so keep everything you wrote and the identifiers the tasks give. The drinks are a struct:
struct Drink: Identifiable {
let id = UUID()
let name: String
let price: Double
}This step builds the menu: a NavigationStack with a List, one row per drink, the name on the left and the price on the right.
Challenge
EasyBuild the menu screen. Inside the NavigationStack, show a List of drinks titled Coddy Coffee. Each row is an HStack with the drink's name, a Spacer and its price with two decimals, such as $2.50.
Try it yourself
import SwiftUI
@main
struct CoddyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to SwiftUI
Practice on your own: Swift playground