MVVM-C based iOS-Architecture Reference
Name Eris
is inspired from here
Architecture is divided in the following independently injectable and testable layers.
Layers are defined here.
Application Screenflow and later Push Routing handler.
Display of data. Data is being displayed in the form of Models and views confrom to ModelConfigurable to populate data via configure(model:)
method
Controller contains logic of view's state representation and pass actions to viewModel
bindings
.Domain Usecases
. Any domain logic will be injected in the form of independently tested usecases. Idea is to keep Domain-Layer
independent from ViewModels thus can be widely reuseable
. Current implementation doesn't contain any domain logic thus doesn't contain any mapper.Its an abstraction layer
between ViewModel
and Data Stores
that encapuslates Data-source layer. Currently there are two data sources, Network and CoreData. This layer can encapulate further data sources aswel i-e Remote Configurations etc
Network: Its a wrapper written on top of Swift Package Ceres
which fetch and decode data into inferred model object.
CoreData: Persistor encapsulates CoreData and fetches and updates data.
Following are few considerations while writing code
MVVM-C
Architecture.dependency management
and lays foundation for high level DI-Frameworktestable
and mocks can easily replaced with original objectsiOS Swift Style Guidelines
and have same styling throughtout the code.scale
as big as it can beFolder structure
is highligting the architectureModule (Swift Package)
Protocols
NWPath.Status
doesn't return .satisfied
on simulator so for getting best results please test on device.A detailed article was published on Medium and can be found here