Get Updates By E-mail 

Article Written By:
Johann Dowa

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

  • 10
  •  
  •  
  •  
  •  

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.


  • 10
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments