iOS Architecture
Installation
SKILL.md
iOS Architecture Standards
Priority: P0
Implementation Guidelines
MVVM (Model-View-ViewModel)
- ViewModel Responsibility: Handle business logic, formatting, and state. No UIKit imports (except for platform types like
UIImageif strictly necessary). - ViewState: Use a single state object or discrete
@Publishedproperties for UI updates. - Inputs/Outputs: Define explicit protocols or nested types for inputs (events from View) and outputs (state for View).
Coordinator Pattern
- Navigation Logic: Decouple ViewControllers from navigation logic. The Coordinator handles instantiation and push/present.
- Dependency Injection: Pass dependencies (Services, Repositories) through the Coordinator into the ViewModels.
- Child Coordinators: Maintain a hierarchy; remove child coordinators when their flow is finished.