Theodolite is a declarative framework for building efficient user interfaces (UI) on iOS. It allows you to write highly-optimized Android views through a simple functional API based on Swift protocols. It was primarily built to implement complex scrollable UIs based on UICollectionView.

With Theodolite, you build your UI in terms of components instead of interacting directly with traditional UIKit views. A component is essentially a function that takes immutable inputs, called props, and returns a component hierarchy describing your user interface.

1
2
3
4
5
6
7
8
9
10
final class HelloComponent: Component, TypedComponent {
  typealias PropType = String

  override func render() -> [Component] {
    return LabelComponent {
      ("Hello \(self.props())", 
        LabelComponent.Options())
    }
  }
}

You simply declare what you want to display and Theodolite takes care of rendering it in the most efficient way by computing layout in a background thread, automatically flattening your view hierarchy, and automatically reusing views in complex component hierarchies.

Part of the Family

Theodolite is built to be nearly identical to Facebook’s Litho and ComponentKit native React frameworks.

Continue exploring

Have a look at our Tutorial for a step-by-step guide on using Theodolite in your app. You can also read the quick start guide on how to write and use your own Theodolite components.

Edit on GitHub