LayoutKit

screenshot of LayoutKit

LayoutKit is a fast view layout library for iOS, macOS, and tvOS.

Overview

LayoutKit is a fast view layout library for iOS, macOS, and tvOS. It was created by LinkedIn because they found that Auto Layout is not performant enough for complicated view hierarchies in scrollable views. LayoutKit provides benefits such as speed, asynchronous computations, declarative layouts, cacheable results, UIKit compatibility, internationalization support, and it is open-source with an Apache License.

Features

  • Fast: LayoutKit is as fast as manual layout code and is significantly faster than Auto Layout.
  • Asynchronous: Layouts can be computed in a background thread, ensuring that user interactions are not interrupted.
  • Declarative: Layouts are declared with immutable data structures, making them easier to develop, document, review, test, debug, profile, and maintain.
  • Cacheable: Layout results are immutable data structures, allowing them to be precomputed in the background and cached for improved performance.
  • UIKit friendly: LayoutKit produces UIViews and provides an adapter for easy use with UITableView and UICollectionView.
  • Internationalization: LayoutKit automatically adjusts view frames for right-to-left languages.
  • Swift compatible: LayoutKit can be used in Swift applications and playgrounds.
  • Tested and production ready: LayoutKit is thoroughly tested and used in recent versions of the LinkedIn and LinkedIn Job Search iOS apps.
  • Open-source: LayoutKit is not a black box like Auto Layout and is released under the Apache License (v2) to avoid patent issues.

Summary

LayoutKit is a powerful, open-source view layout library for iOS, macOS, and tvOS. It offers fast and asynchronous layout computations, declarative layouts, cacheable results, and compatibility with UIKit. Although it is not a constraint-based layout system like Auto Layout, it provides similar benefits and is a reliable choice for complex view hierarchies in scrollable views.