LayoutKit – Swift Library Providing A Higher-Performance Auto Layout Alternative

LayoutKit is an open source interface layout library from LinkedIn that was created to provide increased performance over the iOS SDK’s auto layout for complex layouts in scrollable views.

LayoutKit is as fast as manually laying out code, and considerably faster than auto layout, provides caching for increased performance, and layouts can be created within background threads.

LayoutKit syntax is clean, and similar to flexbox – here is a code snippet from the readme:

let image = SizeLayout<uiimageview>(width: 50, height: 50, config: { imageView in
    imageView.image = UIImage(named: "earth.jpg")
})

let label = LabelLayout(text: "Hello World!", alignment: .center)

let stack = StackLayout(
    axis: .horizontal,
    spacing: 4,
    sublayouts: [image, label])

let insets = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 8)
let helloWorld = InsetLayout(insets: insets, layout: stack)
helloWorld.arrangement().makeViews(inView: rootView)

You can find LayoutKit on Github here.

A nice high performance view layout library.

Original article: LayoutKit – Swift Library Providing A Higher-Performance Auto Layout Alternative

©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *