“...if you prefer your Auto Layout hand
crafted in code then you might want to
have a look at this new library (...)
There's plenty of libraries that give a
new syntax to NSLayoutConstraints, but
I really liked the look of this one...”
iOS Dev Weekly, issue 246
red.easy.layout(
Size(*0.5),
Center(0.0)
)
blue.easy.layout(
Size(20.0).like(red),
CenterX(0.0).to(red),
CenterY(0.0).to(red)
)
layoutGuide.easy.layout(
Size(CGSize(220.0, 130.0)),
Center(0.0)
)
red.easy.layout(
Width(*0.5).like(layoutGuide),
Leading(0.0).to(layoutGuide),
CenterY(0.0).to(layoutGuide),
Height(50.0),
)
...
blue.easy.layout([
Size(90.0),
Center(0.0)
].when {
$0.isPhone
})