-
The app architecture is MVC and follows Cocoa design patterns whenever fit.
-
Views are composed of storyboards and custom xib.
-
A single ViewController that manages and ties everything together.
-
The model consists of a singleton
Linesclass which provides a globally accessible, shared instance. It has the propertylinesListwhich is a structLinesListwhich consist of an array of a structLine, which in turn contains a structStation, which has structLocation. All structs are conforming toCodableprotocol which helps converting them at ease to and from external representations such as JSON. -
All networking are done via the singleton class of
NetworkManager, which is a unified access point to make HTTP requests. And each type of request is done via a dedicated method. -
When the main view controller
MapViewControllerfirst loaded, it subscribes to a custom Notification, then asks theLinesmodel via its singleton instance to fetch the lines, which in turn fetches them via the API using theNetworkManager. And then posts a notification using theNotificationCentervia property observer. The notification is received by the subscribedMapViewControllerand refreshes thelinesasynchronously.
kalamoni/SWVL-Challenge
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|