Modern SwiftUI patterns for building declarative, performant user interfaces on Apple platforms. Covers the Observation framework, view composition, type-safe navigation, and performance optimization.
| @State | View-local value types (toggles, form fields, sheet presentation) | | @Binding | Two-way reference to parent's @State | | @Observable class + @State | Owned model with multiple properties | | @Observable class (no wrapper) | Read-only reference passed from parent | | @Bindable | Two-way binding to an @Observable property |
Use @Observable (not ObservableObject) — it tracks property-level changes so SwiftUI only re-renders views that read the changed property:
Modelli di architettura SwiftUI, gestione dello stato con @Observable, composizione della vista, navigazione, ottimizzazione delle prestazioni e best practice moderne per l'interfaccia utente iOS/macOS. Fonte: affaan-m/everything-claude-code.