Open Sourcing ReactiveLists for iOS

Benjamin Encz
PlanGrid Technology
3 min readFeb 7, 2018

Over the last few years the PlanGrid iOS team has built a bunch of internal APIs that have allowed us to ship new features faster and more consistently.

Today we are releasing the first component publicly — you can now find it on GitHub 🎉.

Our team has many open-source enthusiasts and we also use a fair share of open-source libraries, so we always had planned to release these components over time.

Declarative UI programming with UIKit

ReactiveLists is a React-like API built on top of UITableView and UICollectionView. That API allows us to write stateless functions to generate user interfaces. In our experience these stateless functions are a lot easier to comprehend than the *DataSource , *Delegate types that are the standard pattern for providing data to UIKit components.

API usage typically looks like in the example below, you write a function that maps data to ReactiveLists view models, resulting in a very readable stateless function:

Not only does this make the UI code easy to read and iterate on, but it also makes it easily testable. Our team member Benjamin Encz has discussed the advantages of this declarative UI programming approach in depth in his talk “Turning UIKit inside out”.

From closed to open

We have many folks on the team that have contributed to open source projects or created their own projects from scratch. The experience of open-sourcing a component that has evolved within an existing codebase has turned out to be significantly different. We spent a few engineering days moving the component into its own Swift framework, removing dependencies on the core app and its unit test helpers, moved a ReactiveSwift integration into an extension, and spent significant time renaming APIs, improving documentation and refactoring our test suite. On top of that we built an example app that makes the library easier to comprehend.

This is another benefit of building for the open — it raises the bar of components that are used throughout large portions of our codebase.

Ready for production but not 1.0.0

We did not wait until this library is done before releasing it to the public as we believe it adds a lot of value in its current state. The version we have released is the version that has been shipping in the PlanGrid iOS app for almost two years. Therefore we definitely consider the library ready for production. That said we are expecting of a bunch of improvements and breaking API changes down the road and therefore are releasing this version as a 0.1.0.

Conclusion

We consider this the first step in sharing some of our internal APIs with the iOS community. We see the benefits from leveraging open source software every single day and are excited to be able to contribute back.

Of course, PlanGrid is hiring iOS engineers. You can read more about the team. Or apply directly.

--

--