Skip to content

iOS architecture proposal - clean architecture

Notifications You must be signed in to change notification settings

mantuness/MacroApp

Repository files navigation

MacroApp - iOS architecture proposal

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.

Important Swinject reading

Layers

  • 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

Regarding dependencies:

  • 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)

Additional notes:

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"

Some useful links and inspiration:

About

iOS architecture proposal - clean architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages