A family of Functional Reactive Programming-inspired frameworks for Objective-C and Swift.

The ReactiveCocoa logo, generously contributed by Reda Lemeden (@kaishin)

ReactiveCocoa (RAC) was created by Josh Abernathy in early 2012 as a reactive programming framework for Objective-C—inspired by .NET’s Reactive Extensions (Rx), but developing some key differences. I joined the project in mid-2012, and in addition to making major coding contributions, I drove the technical direction for the 1.0, 2.0, and 3.0 major version releases.

The RAC 3.0 release was particularly notable in its scope, as it was the first release following Apple’s introduction of the Swift programming language. I designed an entirely new API for ReactiveCocoa in Swift, and published a very detailed explanation and migration guide, while also implementing a compatibility layer for users to bridge the Objective-C and Swift APIs together (as few real-world projects were 100% written in Swift at that point). Today, now that the language has matured, the Swift and Objective-C APIs have been split out into their own frameworks: ReactiveSwift and ReactiveObjC.

ReactiveCocoa made MVVM (Model-View-ViewModel) possible in Cocoa applications

At GitHub, we used each version of RAC extensively while developing GitHub for Mac—the native precursor to today’s Electron-based GitHub Desktop—to orchestrate the heavily asynchronous workloads it required, and react to outside changes as they happened. We also adopted and became early evangelists of the Model-View-ViewModel architectural paradigm in Cocoa applications, which was impractical before we had ReactiveCocoa’s expressive bindings language. We even explored the idea of RAC-powered animations!

“The Future of ReactiveCocoa” (slides and presenter notes available)

In 2014, fellow team member Danny Greg and I organized RACDC, or the ReactiveCocoa Developers Conference (jokingly styled after Apple’s WWDC), where I gave a talk about the key goals I had in mind for ReactiveCocoa 3.0, which would become the next major release. The Swift programming language ended up being announced the same week, which dramatically shifted our efforts toward the new language—but my key goal of simplification remained.

After years of being the only fully-featured reactive programming framework in the Cocoa community, Rx was ported to Swift—offering a direct 1:1 API mapping for developers familiar with Rx on other platforms, in contrast to ReactiveSwift’s differences. Although I still believe we made the right decision when prioritized simplicity and platform convention over strict translatability, the new library gave Cocoa developers the choice, benefiting everyone. More recently, Apple introduced its own reactive programming library for Swift, Combine, undoubtedly influenced by the huge impact that ReactiveCocoa and RxSwift have had on iOS and macOS developers!

I stopped working on ReactiveCocoa when I joined Facebook, as I would no longer be using it day-to-day, and have always felt that the best open source maintainers should be dogfooding their work constantly. ReactiveCocoa remains under active development, thanks to several amazing key contributors and a thriving open source community.

Leave a Reply