Migrate a ViewModel to @Observable
When to use: App is iOS 17+ but ViewModels still ObservableObject + @Published.
Flow
-
InventoryAxiom: list every ObservableObject + @Published in the project. Note which are leaf vs shared.✓ Copied→ List with shape + dependency hints
-
Migrate oneRefactor ProfileViewModel to @Observable. Keep the public API stable. Update its View consumers' bindings.✓ Copied→ VM migrated; @Bindable used in views; no @Published left
-
VerifyRun xcodebuild for the scheme. Report any warnings.✓ Copied→ Clean build; no Swift 6 warnings
Outcome: Modern @Observable codebase with cleaner views.
Pitfalls
- Existing tests rely on @Published projection ($name) — Tests need rewriting; not all access patterns map directly