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:
- 03-ImageUiDemo-1-symbols (Page1–Page9)
- 03-UIGraphics-View
- 04-Audio-State-Demo (PlayAudioView)
- 05-AppStorageDemo (Check-in page)
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
Page9the app's first screen. - Added the
UIGraphicsImageRendererdemo and renamed itsContentViewtoUIGraphicsView, since an app can only have one struct with each name. - Added
PlayAudioViewand its three.m4afiles. The files have to be inside the app's folder orloadBundleAudiocan'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.
@AppStorageonly takes simple types (String, Int, Double, Bool...), so the last visit time is saved as aDoubleand turned back into aDateto show it.- Noticed the "My Shapes" title never showed.
.navigationTitlewas outside theNavigationView, and moving it onto theListfixed 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
NavigationViewis deprecated. When should I switch toNavigationStack, and what changes?PlayAudioViewusesBundle.main.path(...)!, which crashes if a file is missing. What's a safer way to load sounds?@AppStoragekeys 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'sCanvas(Week03)?