CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

NSLayoutConstraint-SSLayout 1.2

NSLayoutConstraint-SSLayout 1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2018

Maintained by Ruihai Su.



  • By
  • stevenSu

simple and easy-to-use, 2files only, 17kB size.
similar usage as NSLayoutAnchor, but support iOS-8 and "swiftable".
1.7 times faster than Masonry, nearly as fast as the system method.
track all constraints and easy to activate/deactivate any one of them.

Example

Setup constraints

[self.redView activateConstraints:^{
        self.redView.height_attr.constant = 100;
        self.redView.width_attr = self.blueView.width_attr;
        self.redView.top_attr = self.blueView.top_attr;
        self.redView.leading_attr = self.blueView.trailing_attr;
    }];

Alter value of a constraint

self.blueView.width_attr.constant = 100;

Obtain a constraint

NSLayoutConstraint *cons = [self.titleLabel constraintAccordingToAttribute:self.titleLabel.bottom_attr andAttribute:self.subtitleLabel.top_attr];

Adding to your project

Including Source Directly Into Your Project

Add the files under "Source" folder to your project.

Licence

This project uses MIT License.