This is a proof of concept project which demonstrates:
It has:
- Repository (Logic)
- UseCase (Logic)
- Builder (UI)
- Wireframe (UI)
- Presenter (UI)
It doesn't have:
- DataStore (merged into Repository)
Clean Architecture is basically extension of MVVM, so I only chose couple of components to fit my needs for current (and potentially future) state of this project.
There are number of frameworks:
- AbceedCore: Common types and extensions (non-UI)
- AbceedLogic: Core Business Logic (ViewModel)
- AbceedUI: Common UI Components (View, ViewController, Wireframe and Builder)
It's still proof of concept, but feels okay to me.
Logic
depends onCore
UI
depends on bothCore
andLogic
Frameworks are linked statically, so there's no runtime overhead compared to monolithic app target.
Other notes on code separation are:
- UseCase's interface is in
Core
, UseCase's impl is inLogic
. This way for exampleUILibrary
target technically doesn't requireLogic
target.
All UI components are separated from main target, which means I can run app target without actual network or database I/O.
This allows to show interested View or ViewController independently.
This boosts up the UI development iteration cycle especially when project gets very large.
- UILibrary: Runs UI with mock data. Could have been a Xcode Playground too.
And of-course this makes it easy to test presentation layer using UITesting or snapshot testing etc..
- https://dev.classmethod.jp/smartphone/iphone/clean-architecture-and-derivative-systems-for-ios
- https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md
- Xcode 11.4
xcodegen
make test-all
MIT