Skip to content

Commit

Permalink
added NSLayoutConstraint convenience methods
Browse files Browse the repository at this point in the history
  • Loading branch information
fgeistert committed Feb 15, 2024
1 parent 5467e14 commit f94ad2b
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#if canImport(UIKit)

import UIKit

public extension NSLayoutConstraint {

func priority(_ priority: UILayoutPriority) -> NSLayoutConstraint {
let constraint = self
constraint.priority = priority
return constraint
}

func constant(_ constant: CGFloat) -> NSLayoutConstraint {
let constraint = self
constraint.constant = constant
return constraint
}
}

#endif

0 comments on commit f94ad2b

Please sign in to comment.