RxSwift is a powerful framework and, as always, with power comes responsibility.

RxSwift is a powerful framework and, as always, with power comes responsibility. In RxSwift the memory is usually managed through an object called a DisposeBag.

For instance, every time we subscribe to an Observable, RxSwift makes sure the subscription is kept in memory until either a .completed or .error event is received or the subscription is being garbage collected by the DisposeBag.

It is fairly easy to make a mistake and to add the subscription to a wrong DisposeBag. For example, to add it to the controller’s bag instead of the cell’s. Mistakes happen and to catch them early it is a good idea to add a resource counting mechanism to each view controller. The mechanism will make sure resources allocated during the lifetime of the view controller are released and if no, will output an error.

Infinum provides a default implementation of such a mechanism.

Welcome to The infinite monkey theorem

Somewhere a monkey just typed Shakespeare in TypeScript. Be the first to read the masterpieces (and the hilarious misfires) landing on the blog.

Subscribe to The infinite monkey theorem

We fling fresh posts—no banana peels attached—straight to your inbox.