This project was designed taking into consideration a clean architecture and a MVVM+C pattern for the presentation layer. To accomplish the injection of dependencies we chose to use Swinject, a lightweight dependency injection framework for Swift.
- Domain Layer = Models + Use Cases + Repositories Interfaces
- Data Repositories Layer = Repositories Implementations + Mappers
- Services/Platforms (1 layer for each) = API (Network) + Persistence DB
- App (MVVM+C) = ViewModels + Views + Coordinators
- Domain - depends on no one
- Data - depends on Domain and JSPlatform or any other service/platform implementation (example: Persistence DB)
- JSPlatform - depends on no one
- App - depends on every module (Domain, Data, JSPlatform)
JSPlatform module was created to abstract all JS layer (tried an approach like a network API, please check the folder API that will have all the "services" provided by JS)
In the end what will happen is: ViewController -> ViewModel -> UseCases -> Repositories -> "Services/Platforms"
- CleanArchitectureRxSwift by sergdort
- The Clean Code Blog by Uncle Bob