Essential session storage is required to sign in. Optional analytics remain off unless you allow them.
Build a multi-screen SwiftUI app that fetches data from a REST API and persists locally. Use MVVM: a view model (ObservableObject or @Observable) exposes UI state; fetch with URLSession + async/await and decode JSON with Codable, doing the work off the main thread and updating UI on the main actor; persist with SwiftData or Core Data and show cached data offline. Handle loading/success/error states, navigate list→detail with NavigationStack, and add a couple of unit tests for the view model with a mocked service.
Clean MVVM with a view model holding UI state; logic out of views; unidirectional data flow; dependency injection for the service.
URLSession + async/await + Codable correct; main-actor UI updates; SwiftData/Core Data caching; ATS/HTTPS respected.
Loading/success/error handled; list→detail via NavigationStack; sensible empty/error UI.
View model unit-tested with a mock service (protocol-based); async tests pass.
Use this README structure to make the work reviewable.
DevPath fetches a read-only, size-capped snapshot. Submitted code is never executed.
# An MVVM app with networking and persistence ## Goal Build a multi-screen SwiftUI app that fetches data from a REST API and persists locally. Use MVVM: a view model (ObservableObject or @Observable) exposes UI state; fetch with URLSession + async/await and decode JSON with Codable, doing the work off the main thread and updating UI on the main actor; persist with SwiftData or Core Data and show cached data offline. Handle loading/success/error states, navigate list→detail with NavigationStack, and add a couple of unit tests for the view model with a mocked service. ## Acceptance criteria - [ ] Architecture: Clean MVVM with a view model holding UI state; logic out of views; unidirectional data flow; dependency injection for the service. - [ ] Async & persistence: URLSession + async/await + Codable correct; main-actor UI updates; SwiftData/Core Data caching; ATS/HTTPS respected. - [ ] UX states & nav: Loading/success/error handled; list→detail via NavigationStack; sensible empty/error UI. - [ ] Testing: View model unit-tested with a mock service (protocol-based); async tests pass. ## Verification - [ ] Document installation and run commands. - [ ] Record automated checks and their exact commands. - [ ] Add representative output, screenshots, or a short demo where useful. - [ ] Confirm failure paths and known constraints. ## Decision log ### Decision title - Context: - Choice: - Alternatives considered: - Tradeoffs: ## Evidence - Link each rubric criterion to the file, test, or artifact that demonstrates it. ## Known limitations - List what is intentionally out of scope and what should be improved next.