added priority
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
6604036bf7
commit
17705efcb8
@ -49,8 +49,8 @@ extension UILayoutGuide {
|
||||
/// Adds a heightAnchor.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func height(_ constant: CGFloat) -> Self {
|
||||
height(constant: constant)
|
||||
public func height(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
height(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -58,8 +58,8 @@ extension UILayoutGuide {
|
||||
/// Adds a heightAnchor where the height constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func heightGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
heightGreaterThanEqualTo(constant: constant)
|
||||
public func heightGreaterThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
heightGreaterThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -67,8 +67,8 @@ extension UILayoutGuide {
|
||||
/// Adds a heightAnchor where the height constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func heightLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
heightLessThanEqualTo(constant: constant)
|
||||
public func heightLessThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
heightLessThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -76,24 +76,24 @@ extension UILayoutGuide {
|
||||
/// Adds a heightAnchor for the constant passed into the method.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func height(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(equalToConstant: constant).activate()
|
||||
public func height(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(equalToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a heightAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func heightGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||
public func heightGreaterThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a heightAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func heightLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||
public func heightLessThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(lessThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
}
|
||||
@ -107,8 +107,8 @@ extension UILayoutGuide {
|
||||
/// Adds a widthAnchor.
|
||||
/// - Parameter constant: Width Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func width(_ constant: CGFloat) -> Self {
|
||||
width(constant: constant)
|
||||
public func width(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
width(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -116,8 +116,8 @@ extension UILayoutGuide {
|
||||
/// Adds a widthAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func widthGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
widthGreaterThanEqualTo(constant: constant)
|
||||
public func widthGreaterThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
widthGreaterThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -125,8 +125,8 @@ extension UILayoutGuide {
|
||||
/// Adds a widthAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func widthLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
widthLessThanEqualTo(constant: constant)
|
||||
public func widthLessThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
widthLessThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -134,24 +134,24 @@ extension UILayoutGuide {
|
||||
/// Adds a widthAnchor for the constant passed into the method.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func width(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(equalToConstant: constant).activate()
|
||||
public func width(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(equalToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a widthAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func widthGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||
public func widthGreaterThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a widthAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func widthLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||
public func widthLessThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(lessThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -56,8 +56,8 @@ extension UIView {
|
||||
/// Adds a heightAnchor.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func height(_ constant: CGFloat) -> Self {
|
||||
height(constant: constant)
|
||||
public func height(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
height(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -65,8 +65,8 @@ extension UIView {
|
||||
/// Adds a heightAnchor where the height constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func heightGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
heightGreaterThanEqualTo(constant: constant)
|
||||
public func heightGreaterThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
heightGreaterThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@ extension UIView {
|
||||
/// Adds a heightAnchor where the height constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func heightLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
heightLessThanEqualTo(constant: constant)
|
||||
public func heightLessThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
heightLessThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -83,24 +83,24 @@ extension UIView {
|
||||
/// Adds a heightAnchor for the constant passed into the method.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func height(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(equalToConstant: constant).activate()
|
||||
public func height(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(equalToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a heightAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func heightGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||
public func heightGreaterThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(greaterThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a heightAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func heightLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||
public func heightLessThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
heightAnchor.constraint(lessThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
}
|
||||
@ -114,8 +114,8 @@ extension UIView {
|
||||
/// Adds a widthAnchor.
|
||||
/// - Parameter constant: Width Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func width(_ constant: CGFloat) -> Self {
|
||||
width(constant: constant)
|
||||
public func width(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
width(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -123,8 +123,8 @@ extension UIView {
|
||||
/// Adds a widthAnchor where the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func widthGreaterThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
widthGreaterThanEqualTo(constant: constant)
|
||||
public func widthGreaterThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
widthGreaterThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -132,8 +132,8 @@ extension UIView {
|
||||
/// Adds a widthAnchor where the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: Yourself.
|
||||
public func widthLessThanEqualTo(_ constant: CGFloat) -> Self {
|
||||
widthLessThanEqualTo(constant: constant)
|
||||
public func widthLessThanEqualTo(_ constant: CGFloat, _ priority: UILayoutPriority = .required) -> Self {
|
||||
widthLessThanEqualTo(constant: constant, priority: priority)
|
||||
return self
|
||||
}
|
||||
|
||||
@ -141,24 +141,24 @@ extension UIView {
|
||||
/// Adds a widthAnchor for the constant passed into the method.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func width(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(equalToConstant: constant).activate()
|
||||
public func width(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(equalToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a widthAnchor with the constant passed in using a greaterThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func widthGreaterThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).activate()
|
||||
public func widthGreaterThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(greaterThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
/// Adds a widthAnchor with the constant passed in using a lessThanOrEqualTo Constraint.
|
||||
/// - Parameter constant: Constant size.
|
||||
/// - Returns: The Constraint that was created.
|
||||
public func widthLessThanEqualTo(constant: CGFloat) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(lessThanOrEqualToConstant: constant).activate()
|
||||
public func widthLessThanEqualTo(constant: CGFloat, priority: UILayoutPriority = .required) -> NSLayoutConstraint {
|
||||
widthAnchor.constraint(lessThanOrEqualToConstant: constant).with { $0.priority = priority; $0.isActive = true }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user