It's an iOS simple project that how I implement MVP
(Model-View-Presenter) and Clean Architecture
in Swift.
- Xcode 10.2+
- Swift 5.0+
View
- Displays information from thePresenter
and sends user interactions back to thePresenter
.Presenter
- Contains the presentation logic and tells theView
what to presentViewBuilder
- TheBuilder’s
responsibility is to instantiate a specificView
and injects the dependency for all components.Router
- Handles navigation logic for which screen should appear and when.
UseCase
- Contains the business logic for a specific use case in the project. They are view agnostic and can be consumed by one or manyPresenters
.Model
- Simple data model objects.
Repository
- Query objects from different data sources (Core Data, Realm, web server, etc.) with a only single-entry point.
- iOS: MVP clean architecture in Tiendeo app
- Library - iOS - MVP + Clean Architecture Demo
- The Clean Architecture, by Uncle Bob
- Test Double
Nixon Shih, [email protected]
Swift-MVP-Sample is available under the MIT license. See the LICENSE file for more info.