Releases: kean/Align
Align 0.3.1
A small update that focuses on improving offsetting(by:)
method.
offsetting(by:)
method now available for all anchors- Add an operator that wraps
offsetting(by:)
method (which wasn't very convenient to use by itself) - [Fix] Offsetting anchor which already has an offset now works correctly
- Split the project into two files
Align 0.3
-
With new
addSubview(_:constraints:)
method you define a view hierarchy and layout views at the same time. It encourages splitting layout code into logical blocks and prevents programmer errors (e.g. trying to add constraints to views not in view hierarchy). -
Remove standalone
fillSuperview(..)
andcenterInSuperview()
family of functions. There were multiple cons of having them (e.g. more terminology to learn, hard to document and explain, inconsistent withcenter
andsize
manipulations, were not allowing to pin in a corner).
Now you can manipulate multiple edges at the same time instead:
view.addSubview(stack) {
$0.edges.pinToSuperview() // pins the edges to fill the superview
$0.edges.pinToSuperview(insets: Insets(10)) // with insets
$0.edges.pinToSuperviewMargins() // or margins
$0.edges(.left, .right).pinToSuperview() // fill along horizontal axis
$0.centerY.alignWithSuperview() // center along vertical axis
}
This is a much simpler model which removes entire layer of standalone methods available on LayoutItems
. Now you always select either an anchor
or collections of anchors
, then use their methods to add constraints. Much simpler.
- Make LayoutProxy's
base
public to enable adding custom extensions on top of it.
Align 0.2
- Redesigned Align API which now follow Swift API Design Guidelines. Although most of the APIs are compact, it is a non-goal to enable the most concise syntax possible. Instead Align provides a fluent APIs that form grammatical phrases.
- Full test coverage
- Add a new comprehensive overview, full guide, and installation guide
Align 0.1.1
Revert to original Spacer
design.