A SwiftUI sample app demonstrating Clean Architecture with SwiftData, Combine, dependency injection, and full test coverage.
Clean Architecture for SwiftUI is a sample iOS application that demonstrates how to build a SwiftUI app using Clean Architecture principles. It solves the problem of tightly coupled code by separating concerns into distinct layers (presentation, business logic, data access), making the app more testable, maintainable, and scalable. The app fetches and displays country data from a REST API while showcasing modern SwiftUI features.
iOS developers, particularly those working with SwiftUI, who want to learn or implement Clean Architecture in their projects. It's also suitable for developers interested in best practices for dependency injection, testing, and data persistence in SwiftUI apps.
Developers choose this project because it provides a complete, production-ready example of Clean Architecture in SwiftUI, with full test coverage and modern Apple technologies like SwiftData and Combine. It offers clear separation of concerns, making code easier to maintain and test compared to traditional MVC or MVVM approaches.
SwiftUI sample app using Clean Architecture. Examples of working with SwiftData persistence, networking, dependency injection, unit testing, and more.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements distinct Presentation, Business Logic, and Data Access layers, as shown in the architecture diagram, ensuring maintainability and testability by decoupling UI from core logic.
Includes unit and UI tests using the ViewInspector framework, with code coverage badges indicating a commitment to robust testing practices.
Leverages SwiftUI, Combine, async-await networking, and SwiftData for persistence, showcasing up-to-date Apple technologies in a production-ready example.
Supports deep linking and push notifications through a centralized AppState, enabling complex navigation flows without relying on SwiftUI's built-in navigation.
The strict Clean Architecture separation can introduce boilerplate and complexity for simpler apps, as the README notes choices between AppState loading and Binding for data handling.
Requires familiarity with Clean Architecture principles, Combine, and SwiftUI's environment, which may be daunting for developers new to these patterns.
Heavily dependent on SwiftUI, Combine, and SwiftData, making it less adaptable for projects that need to integrate with non-Apple platforms or legacy codebases.