Skip to content

Commit

Permalink
Remove duplicate definitions of ~
Browse files Browse the repository at this point in the history
  • Loading branch information
rodericj committed Nov 21, 2017
1 parent 340cd25 commit 3be8df5
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions Cartography/Priority.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ precedencegroup CarthographyPriorityPrecedence {
}

infix operator ~: CarthographyPriorityPrecedence
infix operator ~~: CarthographyPriorityPrecedence

/// Sets the priority for a constraint.
///
Expand All @@ -43,8 +44,8 @@ infix operator ~: CarthographyPriorityPrecedence
///
/// - returns: The same constraint with its priority updated.
///
@discardableResult public func ~ (lhs: NSLayoutConstraint, rhs: Float) -> NSLayoutConstraint {
lhs.priority = LayoutPriority(rawValue: rhs)
@discardableResult public func ~~ (lhs: NSLayoutConstraint, rhs: Float) -> NSLayoutConstraint {
lhs.priority = LayoutPriority(rhs)

return lhs
}
Expand All @@ -62,15 +63,3 @@ infix operator ~: CarthographyPriorityPrecedence
}
}

/// Sets the priority for multiple constraints.
///
/// - parameter lhs: An array of `NSLayoutConstraint` instances.
/// - parameter rhs: The new priority.
///
/// - returns: The same constraints with their priorities updated.
///
@discardableResult public func ~ (lhs: [NSLayoutConstraint], rhs: Float) -> [NSLayoutConstraint] {
return lhs.map {
$0 ~ rhs
}
}

0 comments on commit 3be8df5

Please sign in to comment.