SwiftUI-Clean-Architecture-example-with-unit-tests
This is a small project that gets a TODO list from the network, stores it with Filemanager and shows it in a SwiftUI list.
Overview
The project was developed with the following concepts in mind:
No external librariesSOLID principlesClean ArchitectureMVVM ArchitectureUse of Composition rootCoordinator Pattern: Uses UIKit UINavigationController + UIHostingController for navigationFactory PatternRepository PatternUse CasesAsync Await + Result APIsDependency InjectionUnit tests: Although TDD was not used, tests were created after each instance creationTest doubles: Use of Stubs, Spys and MocksTest for memory leaksFolder separation: Domain, Data, Presentation and Framework
Dependency Diagram:
Disclaimer:
This is a very basic project to serve as guide for a tested Clean Architecture approach with SwiftUI.
- Feedback is welcomed.
- I might add some more use cases and features in the near future.
- TODO entity was used throughout the app for simplification sake. True modularity would be achieved by mapping it between layers.
Useful resources that made this possible:
- Essential developer course: Essential Developer
- Hacking with swift: HWS
- Clean Mobile Architecture Book by Petros Efthymiou: Clean Mobile Architecture
- Dependency Injection Principles, Practices, and Patterns by Mark Seemann and Steven van Deursen Dependency Injection
- Clean Architecture Book by Robert C. Martin (Uncle Bob) Clean Architecture
