Created
September 29, 2015 15:14
-
-
Save tolpp/f0b805367a729d2366cc 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
// | |
// ConstraintsWithVisualFormatList.swift | |
// | |
import UIKit | |
extension NSLayoutConstraint { | |
/// - returns : `NSLayoutConstraint` array which is generated from visual format string array | |
class func constraintsWithVisualFormatList(formats: [String], | |
options: NSLayoutFormatOptions = NSLayoutFormatOptions(rawValue: 0), | |
metrics: [String : AnyObject]? = nil, | |
views: [String : AnyObject] | |
) -> [NSLayoutConstraint]{ | |
var result: [NSLayoutConstraint] = [] | |
for format in formats{ | |
let constraints = self.constraintsWithVisualFormat(format, options: options, metrics: metrics, views: views) | |
result = result + constraints | |
} | |
return result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment