busbud/coding-challenge-native-a — pull request #6 by Palleas (2014-12-04 00:43:50+00:00)
Title: Busbud iOS application

Here is my take on this challenge, there are rooms for improvements but it covers pretty much all the toys I like to play with.

# The app
The application is a classic iOS 8.0 application with a little bit of design (a blue background for the navigation bar). It uses cocoapods to resolve the few dependencies I have so don't forget to `pod install` before you open the `Busbud.xcworkspace` file.

# Tests
If you look at the commit history I wrote a couple of units tests before doing anything else. Not only because I wanted to brag about my TDD skills but mostly because using your API seemed to be the most important thing to focus on.

# BBClient
Everything backend-related is performed in this class and uses ReactiveCocoa. Once again there is room for improvement but that's the cool part about having a few tests: refactoring.
For authentication purpose a token is fetched for every call using a dedicated signal that will first look into the keychain and then fetch it from the API if it doesn't exist. One little improvement would be to handle expired tokens.
Note the hardcoded limit parameter that I've used. Since I didn't see a way to have an actual pagination, I didn't really see the point of making the limit count available as a parameter. I've already worked with [paged API in the past](https://github.com/Palleas/StashKit/blob/master/StashKit/STKClient.m#L78-L86).

# Swift
For fun, and because I didn't want to write the whole application in this not-so-mature-but-kinda language, I added a tiny little bit of Swift. That's my approach so far, tiny bits of Swift every now and then when I know it won't make me bust the deadline. That's why the controller loading the webview is written with swift.

That's pretty much it, let me know what you think!