To run the example project, clone the repo, and run pod install
from the Example directory first.
SnapConstraints is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SnapConstraints"
Just use .snap
on any UIView subclass and choose from simple options like .bottom
, .top
, .below
or a bit more complex options like masks .snap.mask([.fill])
.
To snap to the superview's safeArea use .leadingToSafeArea
, .topToSafeArea
, .bottomToSafeArea
, .trailingToSafeArea
.
These constraints cannot be stacked or added in current masks like the rest because they are simple constraints.
All options will automatically activate the constraint/s and will return the last set constraint.
Stefan M. Brighiu (SMBCheeky), sbrighiu@gmail.com
SnapConstraints is available under the Apache License 2.0 license. See the LICENSE file for more info.