Single Source of Truth and Unidirectional Flow
Designing SwiftUI apps with one authoritative state model.
Welcome
Unidirectional data flow means state flows down the view tree, and events flow up. One authoritative source of truth eliminates inconsistency.
The Principle
```
State → View → Event → State mutation → View re-renders
```
Views are pure functions of state. They don't decide what the state is — they only display it and emit events.
All lessons in this course
- @Binding: Two-Way Data Flow
- @ObservableObject and @StateObject
- @EnvironmentObject for Shared State
- Single Source of Truth and Unidirectional Flow