CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ |
| LangLanguage | SwiftSwift |
| License | MIT |
| ReleasedLast Release | Oct 2017 |
| SwiftSwift Version | 4.0 |
| SPMSupports SPM | ✗ |
Maintained by Marc Baldwin.
Create layouts that support every device and orientation.
Alto is still being developed. A stable version will be released very soon. Star or Watch to keep updated with the progress :)
Alto was developed to be:
// Align the center of titleLabel 40px from the top of the container
titleLabel.set(.centerY, .equalTo, containerView, .top + 40)
// Align the centers of titleLabel and subtitleLabel to the container
[titleLabel, subtitleLabel].set(.centerX, .equalTo, containerView, .centerX)This compiles but will cause a crash
NSLayoutConstraint(item: titleLabel, attribute: .height, relatedBy: .equal, toItem:
containerView, attribute: .centerX, multiplier: 1.0, constant: 0.0)This does not compile :)
titleLabel.set(.height, .equalTo, containerView, .centerX) <-- ErrorView the examples and diagrams coming soon
Such as: .center, .size, .edges, .topLeft
titleLabel.set(.center, .equalTo, containerView, .center)
titleLabel.set(.topLeft, .equalTo, containerView, .bottomRight)
titleLabel.set(.edges, .equalTo, containerView, .edges - 5)Apply the same constraints to many views
[titleLabel, subtitleLabel].set(.center, .equalTo, containerView, .center)Create UIStackView style layouts just using constraints
views.stack(.vertically, margin: 20)
views.stack(.vertically, in: containerView, margin: 20)titleLabel.set(.width, .greaterThanOrEqualTo, containerView, .width, priority: .low)