|ReleasedLast Release||Dec 2015|
Maintained by Unclaimed.
|LOCLines of Code||6,802|
ErnKit is a framework with a set of helper classes / protocols and a sample project showing how an iOS project can be broken down into isolated and unit testable components. The framework contains protocols for defining a model layer, as well as a set of helpers using these protocols to show data in table views, map views, as well as getting the data from a RESTful service using RestKit.
The framework can be used as a CocoaPod by adding the following in your Podfile:
After updating your pods all protocols and helpers can be imported like this:
Clone the project and run the following commands:
brew update brew install xctool bundle install pod install open ErnKit.xcworkspace
Xcode will now open and the demo app can be executed from here. To start the demo server run the following command:
To stop it:
Run the unit tests using the following command:
or simply just:
ErnKit defines a set of protocols that defines the overall structure of an iOS application. By adhering to these protocols a lot of the helper classes in ErnKit can be used to achieve a lot writing very little code. ErnKit itself is not a "stack" but a set of components thus exposes all its abstractions in order to be able to choose a level appropriate for the application.
The model of ErnKit consists of two "parts":
The basic idea is to let the repositories hold the model "state" by holding the data objects. The repositories can be updated at any time, and will notify any interested observer when this happens.
A simple example repository could contain a simple object in memory. More complex repositories represents the state of data from a data base or a RESTful server. Either way, the client of the repositores will look the same.
ErnKit defines a set of repository protocols
For example, a repository client can get an object from an ERNAsyncItemsRepository like this:
id<NSObject> object = [repository itemAtIndex:0];