The MVVM-C archeticture was implemeted in this solution as I wanted a flexible code base that allowed me to decouple the View from any business logic and only concern itself with UI presentation and user interaction. By using ViewModels it would also allow for easier unit testing and potential reuse of key components. The use of the Coordinator pattern provides greater flexibilty for reusing VCs and also helps keep the ViewController unaware of the navigation logic
- Due to time constraints I am currently using
UserDefaultsfor persistence. This isn't ideal for a scalable solution, as it should only be used for small bits of data - like strings or integers etc. Moving forward this implementation should utiliseCoreDataorRealmas an offline database. - The
Coordinatorpattern i've implemented doesn't include a separateRouterprotocol and concrete class. Instead I've currently just added the typical router methods in an extension on theCoordinatorprotocol - for now, I think it'll do, but that should be changed. Also, there is only oneCoordinatorprotocol that all the concrete implementations adhere to. If I had more time I would have liked to createParentCoordinatorandChildCoordinatorprotocols for greater flexibilty. - Image downloading and caching is currently done using the third-party library,
Kingfisher. Ideally, a native implementation utlisingURLSessionandNSCacheshould replace it to negate the need for external dependencies and extra baggage in the code base. - The level of unit testing for the application is currently low, as I only had time to test the
NetworkServiceand theFavouritesDataSource. With more time I would have liked to extend the coverage to include more of the ViewModels and Views. By doing this, not only would we have more confidence that the app works as expected even if we were to change the code later, but we would also find out which parts of the code are tightly coupled and thus difficult to test.
- SwiftLint: To ensure the code is of high quality and standards are maintained throughout development, the Xcode project is integrated with Swiftlint to provide static code analysis. To see the configuration of Swiftlint, take a look at
.swiftlint.ymlfile located at the root of the project. - KingFisher: Due the time constraints, I used the Kingfisher library for downloading and caching images from the web.