Swift & SwiftUI
Follow one virtual-pet example from a Swift model into an interactive interface. Read the lessons in this order; each builds on the previous one.
- Object Types: Building Things with State and Behavior — Describe a pet with properties, initialization, and methods.
- From Swift Objects to SwiftUI — Use familiar types and closures to build views, buttons, and local state.
- From Swift Objects to SwiftUI, Part 2: Data Flow and Bindings — Give state a clear owner, split views, and use bindings to request changes.
These lessons assume familiarity with basic Swift variables, functions, and control flow. Each includes questions and expandable answers to help you explain the ideas as you build.