MVVMKit is a protocol oriented library that defines a possible way to adopt the MVVM in your iOS application.
Optionally MVVMKit give you the possibility to take out the navigation responsibility from the view model and put it inside a
In general using MVVMKit most of your software types should belong to one of the following categories:
The actual data manipulated of your applications.
Model type can be
NSManagedObject fetched from a Core Data database or
Codable instances coming from a web server.
- Maintain the state of the application
The user interface. On iOS views are typically subclasses of
- Show the application content.
- Deliver the user interaction to the a
A subclass of
- Deliver the user interaction to the a View Model
- Bind the View Model on the view
Note: on iOS we divide the View entity of the MVVM pattern in two entities:
The actual "brain" of a scene of your application.
- Manage the model
- Present the model in way it is immediately suitable for the view
- Notify the view controller when it should update the view (a.k.a. make a bind)
Is the entity responsible for the application navigation.
- Decide which is (and how to show) the next view controller
- Instantiate view controllers and associated view models doing appropriate dependency injection
To run the example project, clone the repo, and run
pod install from the Example directory first.
MVVMKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
MVVMKit is available under the MIT license. See the LICENSE file for more info.