ReactiveCocoa – Cleaning Up after replay, replayLast, and replayLazily

A while back, I wrote a post comparing replay, replayLast, and replayLazily. Thanks to some investigating by Brian Vanderwal, I recently learned that one needs to be careful when using a replay operator (or multicast/connect directly) with an infinite signal as its source. This blog post refers to the older ReactiveCocoa 2.x Objective-C library. I’m guessing that the […]

Transitioning to ReactiveCocoa 4

If you’ve been reading our blog for any period of time, you’ve probably noticed several posts on the topic of Function Reactive Programming and the ReactiveCocoa library. Up until now, all of these posts have been about ReactiveCocoa 2, which was written in and for Objective-C. Now that Swift is gaining in popularity, the ReactiveCocoa developers […]

Serialize Asynchronous Operations with ReactiveCocoa

In his Easy Asynchronous Operations in iOS with ReactiveCocoa post, John Fisher described how to use -flattenMap to chain together signals that wrap asynchronous operations. He also described a technique for serializing those chains of operations by executing the chain on a serial RACScheduler. The serial scheduler technique works in some situations, but I’ve run […]

Bi-directional Data Bindings in ReactiveCocoa with RACChannel

ReactiveCocoa is a functional-reactive framework for Objective-C that can be leveraged to manage the flow of data within an application. The API provides tools that enable the composition of complex streams that chain data sources to data consumers. Typically, data travels down these streams in one direction—from source to consumer—but on occasion, it’s necessary to have data travel in both […]

ReactiveCocoa Concepts for Asynchronous Libraries

One of the many useful things I’ve found in ReactiveCocoa (a functional reactive programming library for iOS) is the way that it can abstract away the asynchronous callback nature of some iOS core frameworks. And, by making use of RACDisposables, it’s easy to take care of cleanup work like closing connections or stopping a service.

Automated iOS Retain Cycle Testing in Objective-C

When developing an iOS app, one needs to watch out for retain cycles that prevent objects from being deallocated. We’re using ReactiveCocoa heavily on my current project, which means we have a lot of blocks in our code, and thus ample opportunity to introduce a retain cycle (see ReactiveCocoa’s Memory Management documentation for more info).

ReactiveCocoa and the flattenMap Operator

ReactiveCocoa has a number of built-in operators that enable a developer to map, filter, reduce, combine, merge, and flatten steams or signals. It’s a powerful and extensive toolbox, but sometimes it’s not clear under what circumstances these operators should be used. One of my favorite operators is -flattenMap #mapping-and-flattening, and there are a two common […]

Timeouts in ReactiveCocoa

On my current project we are using ReactiveCocoa to manage Core Bluetooth’s asynchronous callbacks when communicating with a Bluetooth Low Energy device in an iOS app. John Fisher recently explained how he’s used ReactiveCocoa to chain asynchronous operations together in this same project. As with any application that communicates with a remote device/server, we’ve run […]