An iOS Developer’s (Mostly) Open Source Toolchest

One benefit of a big platform like iOS is that developers can choose from many tools and technologies. Below are our selections for my current project. Most of them are available via [CocoaPods][cocoapods].


We’re using Objective-C for two main reasons:

* Existing expertise within Atomic.
* A mature and robust ecosystem. (At the time of writing, StackOverflow has ~210k Objective-c [questions][stackoverflow_objective_c]!)

*Alternatives: [Swift][swift_link]; other languages via platform abstraction layers like [Xamarin][xamarin_link], [RubyMotion][rubymotion_link], [Phonegap][phonegap_link], etc.*

[ReactiveCocoa][reactivecocoa] brings [Functional Reactive Programming][link_frp] to Objective-C, and is a favorite around AO. It’s very well suited for asynchronous work like UI and network interaction, helping us keep the majority of our code [lazy][link_lazy] and [functional][link_functional]. A good introduction can be found at [NSHipster][nshipster_rac].

[Objection][objection] is a dependency injection framework created by our own [Justin DeWind][justice]. It enables us to write classes that don’t need to know how to instantiate each other. Paraphrasing from a 2009 I/O [presentation][io_presentation], a dependency injection framework is an *everything-factory* that you don’t have to write or maintain.

We create [mock objects][wiki_mock], stub properties on them, and verify expected behavior with [OCMockito][ocmockito]. I like its permissive behavior, wherein it records function calls as they occur for later verification at the end of the test. This frees us from over-specifying the behavior under test, resulting in unit tests that are less brittle.

*Alternative: [OCMock][OCMock]*

[Specta][specta] is a test runner compatible with XCTest; [Expecta][expecta] is a matcher framework from the same authors. Read more about their merits [here][specta_expecta_ocmockito_external_blog].

*Alternative runners: [Kiwi][kiwi], [Cedar][Cedar], [XCTest][XCTest], [Quick][Quick], [Sleipnir (Swift)][Sleipnir]*
*Alternative matcher: [OCHamcrest][OCHamcrest]*


[KIF][kif] is an integration testing framework that allows us to programmatically interact with an app’s UI. It hooks into iOS’ [accessibility features][ios_accessibility], allowing you to e.g. `waitForViewWithAccessibilityLabel:@”Welcome!”` and then `tapViewWithAccessibilityLabel:@”Next”`.

*Alternatives: [Instruments][instruments], [Zucchini][zucchini]*


[Underscore.m][underscore_m] is “a functional toolbelt for Objective-C” inspired by [underscore.js][underscore_js]. If you find yourself pining for features from functional languages, this is for you.


[Mantle][mantle] provides a number of features that make working with data-holder objects more convenient. Notably, it provides default implementations of `-isEqual:` and the methods for the [`NSCopying`][NSCopying] and [`NSCoding`][NSCoding] protocols.

We build user interfaces with [Masonry][masonry], which wraps [Auto Layout][auto_layout] with a [sweeter][syntactic_sugar] DSL.

[CocoaLumberjack][cocoalumberjack] is a logging framework (see what they did there?). It provides a number of features over the ubiquitous NSLog, notably including the ability to capture the output.

[Hockeyapp][hockeyapp] provides an easy way to get beta builds out to our customer every week. Hopefully we won’t need it, but the crash reporting looks fantastic.


[Open source][atomic_open_source] allows a small team to build great things by [standing on the shoulders of giants][giants_shoulders].

At a consultancy like AO, every new project presents an opportunity to use new tools. What did you choose for your current project?