Archive for April 30, 2013

Tuesday, April 30, 2013

Auto Layout Shorthand

Jonathan Rentzsch:

Auto Layout Shorthand is a poor man’s DSL wedged into a normal Objective-C dictionary literal.

Each key-value pair contains enough information to create one NSLayoutConstraint. This stands in contrast to [the Visual Format Language], where one string can be used to generate multiple constraints.

I like how you don’t have to put your variable names into a string or use NSDictionaryOfVariableBindings().