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
- Create a new SwiftUI project named week12.
- 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
- Create a new SwiftUI file named listStyle and link to it from
ContentView. - 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. - Find the section titled Configuring Font and Color in Chapter 11.
- 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
- Link each item in your list to some destination view. Keep the destination simple — the point here is the back button, not the content.
- Find the section titled Back Button Image and Color in Chapter 11.
- 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
- Create a new SwiftUI view with a list. You can reuse the same list from Part 1.
- Follow the instructions in Chapter 12 to create a modal view that appears when a list row is tapped.
- The modal view must include a floating dismiss button. You can borrow this approach directly from the textbook.
- Add an alert that appears when the floating button is tapped.
- Important: when the book says to “attach the alert modifier to the ScrollView,” place the
.alertmodifier inside theScrollViewat the bottom — not outside it.