easier notation for adding Auto Layout constraints to UIView
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
UIView+jr_addConstraints.h
UIView+jr_addConstraints.m

README.md

UIView+jr_addConstraints

Lets you write:

[scrollView.superview jr_addConstraints:@[
 @"H:|-[scrollView]-|",
 @"V:|-[scrollView(75)]",
 ] views:NSDictionaryOfVariableBindings(scrollView)];

Instead of having to write:

[scrollView.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[scrollView]-|"
                                                                             options:0
                                                                             metrics:nil
                                                                               views:NSDictionaryOfVariableBindings(scrollView)]];
[scrollView.superview addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[scrollView(75)]"
                                                                             options:0
                                                                             metrics:nil
                                                                               views:NSDictionaryOfVariableBindings(scrollView)]];