Menu
Coddy logo textTech

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:

  1. a menu of drinks with their prices
  2. a screen for each drink
  3. a size picker
  4. a quantity stepper and the order's total
  5. 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 icon

Challenge

Easy

Build 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()
        }
    }
}
quiz iconTest yourself

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