Last active
September 5, 2017 16:31
-
-
Save bjhomer/340f569de8e50734fe3b6a6ecc0ae7d1 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
public extension NSLayoutConstraint.Priority { | |
public static func -(lhs: NSLayoutConstraint.Priority, rhs: Float) -> NSLayoutConstraint.Priority { | |
return NSLayoutConstraint.Priority(lhs.rawValue - rhs) | |
} | |
public static func +(lhs: NSLayoutConstraint.Priority, rhs: Float) -> NSLayoutConstraint.Priority { | |
return NSLayoutConstraint.Priority(lhs.rawValue + rhs) | |
} | |
} | |
let constraint = // Some NSLayoutConstraint object. | |
constraint.priority = .required - 1 // Now you can do this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment