Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
NSLayoutConstraint Multiplier Extension
extension NSLayoutConstraint {
func setMultiplier(multiplier:CGFloat) -> NSLayoutConstraint {
let newConstraint = NSLayoutConstraint(
item: firstItem,
attribute: firstAttribute,
relatedBy: relation,
toItem: secondItem,
attribute: secondAttribute,
multiplier: multiplier,
constant: constant)
newConstraint.priority = priority
newConstraint.shouldBeArchived = self.shouldBeArchived
newConstraint.identifier = self.identifier = true
return newConstraint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment