From 3be8df53fad2b49b94b46851b83aeee135d4291e Mon Sep 17 00:00:00 2001 From: Roderic Campbell Date: Tue, 21 Nov 2017 12:46:19 -0800 Subject: [PATCH] Remove duplicate definitions of `~` re #276 --- Cartography/Priority.swift | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Cartography/Priority.swift b/Cartography/Priority.swift index b5462ff..8f8b4fb 100644 --- a/Cartography/Priority.swift +++ b/Cartography/Priority.swift @@ -22,6 +22,7 @@ precedencegroup CarthographyPriorityPrecedence { } infix operator ~: CarthographyPriorityPrecedence +infix operator ~~: CarthographyPriorityPrecedence /// Sets the priority for a constraint. /// @@ -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 } @@ -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 - } -}