Theodolite: A declarative UI framework in Swift


Theodolite uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of immutable inputs and the framework takes care of the rest.

Asynchronous layout

Theodolite can measure and layout your UI ahead of time without blocking the UI thread. By decoupling its layout system from the traditional UIView system, Theodolite can drop the UI thread constraint imposed by iOS.

Flatter view hierarchies

Theodolite uses Yoga for layout and automatically reduces the number of UIViews that your UI contains. This, in addition to Theodolite's text optimizations, allows for much smaller view hierarchies and improves both memory and scroll performance.

Fine-grained recycling

With Theodolite, each UI item such as text, image, or video is recycled individually. As soon as an item goes off screen, it can be reused anywhere in the UI and pieced together with other items to create new UI elements. Such recycling reduces the need of having multiple view types and improves memory usage and scroll performance.

Part of the family

Theodolite is designed with the same underlying ideas and algorithms as Facebook's ComponentKit and Litho libraries. Build on the best ideas from the industry's largest and most successful apps.