Development · GitHub repo
clean-architecture-swiftui
Sample SwiftUI app demonstrating Clean Architecture with modern Swift patterns
An open-source reference project by Alexey Naumov illustrating how to implement Clean Architecture in SwiftUI applications. It demonstrates clear separation of concerns across presentation, business logic, and data layers using modern Apple tooling like SwiftData, async/await, and Swift Testing.
What it's for
- Structure production SwiftUI apps with separated presentation and data layers
- Study best practices for SwiftData persistence and async/await networking
- Implement programmatic navigation and deep linking in SwiftUI
- Set up comprehensive unit and UI tests using ViewInspector and Swift Testing
Features
- Decoupled Presentation, Business Logic (Interactors), and Data Access (Repositories) layers
- Centralized AppState acting as a single source of truth
- Native dependency injection using SwiftUI Environment
- Data persistence powered by SwiftData
- Networking layer built using async/await
- Programmatic navigation supporting deep linking
- Unit and UI test coverage with Swift Testing and ViewInspector
Pricing
Open source
Details
- Type
- GitHub repo
- Category
- Development
- Topic
- App Architecture
- Open source
- Yes
- Platforms
- iOS, macOS
- For
- iOS and macOS developers building SwiftUI applications
- Alternative to
- The Composable Architecture (TCA)
- Tags
- swift, swiftui, clean architecture, swiftdata, ios, testing
Why it was saved
- @nallexn: A canonical reference for structuring SwiftUI apps with Clean Architecture, recently revamped to modern tooling: SwiftData for persistence, async/await replacing Combine, Swift Testing replacing XCTest, and @main App lifecycle.
Related
Deep-dive writeup and open-source release of the Apple Design Award–winning fitness tracker.
Pattern for building a multi-state morphing button in SwiftUI
Engineering guide for building high-performance, streaming-friendly iOS chat message lists.
Index official Apple documentation as reference docs inside Cursor's AI composer
Hardware and software workflow for batch-controlling dozens of physical iPhones
Self-hosted iOS device farm with live browser control and workflow automation.
Updated