05‐Cathy Doss - molab-itp/content-2026-itp GitHub Wiki

This is my wiki page for this class!!

Week 05

Links

My project: BasicNav, one app with a navigation list that holds the class demos (README)

Class repos:

Weekly summary

  • Week 01: Garden.playground, a random emoji garden. First Swift code.
  • Week 02: NYCSkyline.playground, an ascii New York skyline from text files.
  • Week 03: MoodPrint, a multi-view SwiftUI 10print where your mood picks the colors, line thickness and slant.
  • Week 04: Breathe, a breathing guide that uses a timer and sound.
  • Week 05: BasicNav, the class demos gathered behind one navigation list, plus a Check-in page saved with @AppStorage.

Progress

  • Copied Page1–Page9 from 03-ImageUiDemo-1-symbols and made Page9 the app's first screen.
  • Added the UIGraphicsImageRenderer demo and renamed its ContentView to UIGraphicsView, since an app can only have one struct with each name.
  • Added PlayAudioView and its three .m4a files. The files have to be inside the app's folder or loadBundleAudio can't find them.
  • Part 2: added a Check-in page from 05-AppStorageDemo. It remembers your name, your last feeling, and how many times you've visited, even after the app quits.
  • @AppStorage only takes simple types (String, Int, Double, Bool...), so the last visit time is saved as a Double and turned back into a Date to show it.
  • Noticed the "My Shapes" title never showed. .navigationTitle was outside the NavigationView, and moving it onto the List fixed it.

Plans

  • Week06: try the Router from 06-Router instead of NavigationView, and save a list of things (not just single values) as JSON.

Questions

  • NavigationView is deprecated. When should I switch to NavigationStack, and what changes?
  • PlayAudioView uses Bundle.main.path(...)!, which crashes if a file is missing. What's a safer way to load sounds?
  • @AppStorage keys are just strings. If two views spell the key differently, they quietly stop sharing. Is there a safer pattern?
  • What's the difference between drawing with UIGraphicsImageRenderer (UIKit) and with SwiftUI's Canvas (Week03)?