This project is the CodingTask of SIXT company for the iOS Developer position.
Project is created with:
- Xcode version: 12.5
- Swift version: 5.4
- Design Patterns used: Singleton pattern & MVVM
- SOLID & CleanCode
Alamofire - an elegant interface for HTTP network requests in Swift
KingFisher - a powerful, pure-Swift library for downloading and caching images from the web
NVActivityIndicatorView - a collection of loading animations
To run this project, close it locally and then run.
Project consist of a
Viewwhich controls the view(UI).RideModelwhich is the model for data receving from server and in app.NetworkManagerwhich is a manager for network requestsCustomAnnotationwhich is the custom annotation used in appMain.storyBoardwhich is the design.
the main View has 2 parts => MapView to show cars in map and TableView to show list of cars.
In RideView we declare two array of type CustomAnnotation, one to make annotations and one for the map to handle them.
when view appear, we first call the API to get the data we need from server, and then extract the data into CustomAnnotation arrays.
As for map configutarations, we center the map to the first item of the data received, and register for the annotation.
Ride model is a Codable model for the rides we receive from server, and we keep this data for the MapKit and TableView to show them.
RideAPI is a network handler that manage network calls, and if received any data, try to decode it with the RideModel specified earlier.
ViewModel is the viewModel which get the raw data from network requests and make CustomAnnotaiton from those data, then pass it to View
Which is a manager for networks calls, and also handles the errors, and intercept the token(if needed, not used in this project)
So any configuration to the network calls can be managed here, (EventMonitor, Request retries, etc )
This is a custom annotation we build for the data we want to show on map, and also the callout.
To determine if the API can decode the data correctly, first created a json file containing some example of the data receive by server.
Then use those data to test RideAPI. In addition to that, we that model that RideAPI returns, we test configAnnotations of the extractAnnotationsView