Homework 13: Three (or more) in one

This week’s assignment covers three chapters from your recent textbook reading. You’ll build all three exercises inside a single Xcode project, with a link in ContentView to each part.

Get Started

  1. Create a new SwiftUI project named week12.
  2. In ContentView, add navigation links to three separate views — one for each part below. Create those files now so you have somewhere to work.

Part 1: Navigation Bar Customization

  1. Create a new SwiftUI file named listStyle and link to it from ContentView.
  2. Add a list to listStyle. You can use any list you like — including one you’ve built before — but don’t use the exact list from the textbook.
  3. Find the section titled Configuring Font and Color in Chapter 11.
  4. Add a NavigationBar title and customize it dramatically. Don’t just copy the book’s code — make yours look clearly different from the example.

Part 2: Back Button Customization

  1. Link each item in your list to some destination view. Keep the destination simple — the point here is the back button, not the content.
  2. Find the section titled Back Button Image and Color in Chapter 11.
  3. Customize the back button by changing both its image and color. The book uses SF Symbols, but feel free to swap in your own image instead.

Part 3: Modal Views

  1. Create a new SwiftUI view with a list. You can reuse the same list from Part 1.
  2. Follow the instructions in Chapter 12 to create a modal view that appears when a list row is tapped.
  3. The modal view must include a floating dismiss button. You can borrow this approach directly from the textbook.
  4. Add an alert that appears when the floating button is tapped.
  5. Important: when the book says to “attach the alert modifier to the ScrollView,” place the .alert modifier inside the ScrollView at the bottom — not outside it.