11‐Ziyi (Tiffany) - molab-itp/content-2026-itp GitHub Wiki
:))))
Week 01
- Homework: Generative Text Art Playground
- Learning record: Week 01 Learning Record
The Playground generates a TIFFANY text pattern using variables, arrays, loops, conditions, and functions. The learning record covers Swift basics, including types, collections, control flow, functions, and closures, with comparisons to p5.js and JavaScript.
Code notes: Swift checks types more strictly than JavaScript. Parameter labels, range syntax, and trailing closures need attention. The record includes the study hours and questions for each topic.
Week 02
- Homework: ASCII Pumpkin Playground
- Learning record: Week 02 Learning Record
The Playground combines multi-line strings into an ASCII pumpkin. It uses split, map, max, and loops to measure the body width, center the stem, and print the completed image. The learning record also covers structs, computed properties, access control, and value types.
Code notes: multi-line strings preserve the layout of the text art. The record documents an invalid escape sequence and explains how escaping backslashes fixes it. It also compares Swift structs with JavaScript objects.
Week 03
- Homework: Pattern Try
- Learning record: Week 03 Learning Record
Week 04
- Homework: Study Timer
- Learning record: Week 04 Learning Record
The project is a two-page SwiftUI app with Home and Timer pages. It uses NavigationStack and NavigationLink for navigation, @State for the seconds and running flag, and Timer.publish with .onReceive to count seconds. The timer supports Start, Pause, Resume, and Reset.
Code notes: pausing changes the running flag so timer events no longer increase the count. Integer division and remainder format the count as minutes and seconds. The timer state is temporary and is not saved after the app closes.
Week 05
- Homework: Study Timer Storage
- Learning record: Week 05 Learning Record
The project adds a Settings page to the Week04 navigation app. @AppStorage saves a name locally, and Home displays a greeting using the same storage key. $userName binds the TextField to the saved value. The name persists between app launches, while the timer continues to use temporary @State values.
Code notes: the storage key and variable name have different roles. The two views access the same saved value through the shared key; they do not directly access each other's private variables.
Final Project Direction
For my final project, I want to explore phone portability and sensor capabilities as two main differences from desktop experiences. One possible direction is a small everyday assistant app that uses phone sensors to provide practical tools for daily life.
Week 06
- Homework: Study Timer Records
- Learning record: Week 06 Learning Record
Progress
The app adds Save Session and History to the Week05 timer. A StudyRecord stores an ID, a date, and a duration in seconds. Codable, JSONEncoder, and JSONDecoder save and restore the records through studyRecords.json in the app's Documents directory. The timer receives the shared records array through @Binding, and History displays the newest saved sessions first.
Code Notes
A missing file on the first launch means an empty history. An unreadable existing file disables saving to protect its contents. A failed save keeps the current timer value. The shared array is updated only after a successful write. The iOS target compiled successfully, and file-based checks verified saving and reloading multiple records and handling read/write failures.
Next Steps
Continue connecting Swift fundamentals to app data models and explore which local records would be useful for a sensor-based everyday assistant. The main distinction is between temporary timer state, a simple name setting stored with @AppStorage, and a saved array of sessions stored in JSON.