Created
December 8, 2015 18:11
-
-
Save irskep/06822ca3f09898d42664 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| self.view.addConstraints(NSLayoutConstraint.hip_constraintsWithVisualFormats( | |
| ["H:|[label]|", "V:|[label]|"], options: [], metrics: nil, views: ["label": label])) | |
| */ | |
| extension NSLayoutConstraint { | |
| class func hip_constraintsWithVisualFormats( | |
| formats: [String], options: NSLayoutFormatOptions, metrics: [String: AnyObject]?, views: [String: AnyObject]) | |
| -> [NSLayoutConstraint] | |
| { | |
| var constraints: [NSLayoutConstraint] = [] | |
| for format in formats { | |
| constraints += NSLayoutConstraint.constraintsWithVisualFormat( | |
| format, options: options, metrics: metrics, views: views) | |
| } | |
| return constraints | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment