Tiny Constraints – A Swift Library That Provides A Shorter Simpler Syntax For Using Auto Layout

Tiny Constraints is an open source Swift library Robert-Hein Hooijmans that provides syntactic sugar making Auto Layout easier to use.

Tiny Constraints was created to provide the shortest syntax for creating layouts and is 100% compatible with Auto Layout.  You can also store constraints to a variable, stack views together, and more.

This snippet from the readme shows how to create a height constraint, store it, and animate it:

let height = view.height(100)

height.constant = 200
UIViewPropertyAnimator(duration: 1, dampingRatio: 0.4) {
self.layoutIfNeeded()
}.startAnimation()

You can find TinyConstraints on Github here.

A nice library for working with Auto Layout in Swift.

Original article: Tiny Constraints – A Swift Library That Provides A Shorter Simpler Syntax For Using Auto Layout

©2017 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 *