What problem does it solve?
This guide helps iOS teams design or modernize modular applications using Swift Package Manager, aligning project structure and dependencies to enable scalable, testable code.
Core Features & Use Cases
- Modular Architecture Blueprint: Defines the four package layers (Library, Models, Services, ViewComponents) and their responsibilities.
- Dependency Injection: Demonstrates using SwiftUI Environment and RuntimeEnvironment to swap real and mock services for testing.
- Migration Roadmap: Provides a step-by-step approach to migrate existing apps to a modular SPM-based architecture.
- Guidance & References: Includes patterns like Routable, DataStorage, DataStore, and EnvironmentKeys, plus references for data layer, protocols, services, resources, and tooling.
Quick Start
Initialize a modular iOS project by creating the Library, Models, Services, and ViewComponents packages, add Package.swift files, and wire AppScene to use real services on device or mocks in previews.