“...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

/**
This is the syntax. Establishing position and dimension attributes is really straightforward as well as creating relationships between items.
*/


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)
)
/**
It supports UILayoutGuides, just deal with them as you would do with a regular UIView.
*/


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),
)

...
/**
Easily apply lambdas to your constraints.
*/


blue.easy.layout([
    Size(90.0),
    Center(0.0)
].when {
    $0.isPhone
})
/**
But these are just few examples of EasyPeasy's potential.

- Automatic resolution of Auto Layout conflicts.
- Fast and hassle-free update of constraints.
- 100% code coverage.
- 75% documented code.
- Compatible with iOS, macOS and tvOS.
*/