Coding challenge for listing guides
Developed with Xcode Version 10.3 (10G8)
It's a small project so I decided to go with a variation of Apple's MVC, this approach reduces boilerplate code and keeps code easy to follow. I also decided to use Interface Builder
instead of view code because it's faster to prototype and I had to make design decisions on the go.
I did not need any dependecy due to the simplicity of the project, but if I need one, my first choice of dependency manager is Cartage mainly because I feel that it is safer when compared with CocoaPods because CocoaPods with its workspace allows any dependency to include scripts on build steps.
- Created a simple networking layer, using
URLSession
andSwift Codable
for object mapping, that allows mocking responses. - Using ApiRoute to centralize all the API routes that might be called in the Facades.
To add a new route you need to fallow the steps below
- Add a case on
ApiRoute.swift
including itsurl
,method
, andmockFilePath
. - If needed create the
Response
model that represents the server response. - Create a func on a Facade that represents the resource
or
create a new Facade.
- Using class extensions to separate protocol conformations, this is not optimal in terms of compilation time. For large projects, I would go with the
//MARK: -
approach for this separation - Configure tableView in code to avoid hidden IB configurations.
- Better Error handling for failed requests