A simple app that fetches and shows a list of now playing movies using TheMovieDB API.
The app is made using MVVM pattern alongside with the reactive framework RxSwift. The app has Unit Tests for most of the classes, due to the timeframe of the code test some classes where not tested.
- RxSwift
- RxCocoa
- Quick
- Nimble
- RxTest
- RxBlocking
- Mockingjay
With the use of the Coordinator pattern we could have avoid some "ugly" usage of the API Service class, particularly where we push the detail view controller. This would be handled in the Coordinator and we could share the API class with the view models or other coorninators.
Since this is a tech test there are a few compromises made. Here are some of them:
Although I've added caching this is only a memory cache. A better solution would be to have a disk-caching, this could be achieved by having a FileManager
and a DispatchQueue
to save images on disk asyncronously. This caching mechanism should also be seperated so that it could be expanded to support different types of caching. Also ImageService
shouldn't really be a singleton.
I should have tested the cell sizes are correct when orientation changes, there's no ideal way to do this, an approximation would be to ensure that the delegate method returns the correct cell size given the bounds and orientation.
Cell sizes are not entirely pixel perfect and also the layout of the collection view should be custom in order to support better image size/orientation.
Better error handling should also exist in order to visually display them. This could be achieved using a set of common errors, alongside with a custom to return the actual API error. With the use of a Result<T, E: Error>
enum we would be able to return an Observable<Result<T, E>>
and handle the error
appropriately.