From e17ecbfde83430c84c2affb3806982c72e8b7fcb Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Sat, 11 Feb 2017 23:08:01 +1300 Subject: [PATCH] Tweak priority API's for offseting --- Source/ConstraintMakerPriortizable.swift | 4 ++-- Source/ConstraintPriority.swift | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Source/ConstraintMakerPriortizable.swift b/Source/ConstraintMakerPriortizable.swift index ef79448..66aabe6 100644 --- a/Source/ConstraintMakerPriortizable.swift +++ b/Source/ConstraintMakerPriortizable.swift @@ -31,8 +31,8 @@ public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { @discardableResult - public func priority(_ amount: ConstraintPriority) -> ConstraintMakerFinalizable { - self.description.priority = amount.value + public func priority(_ amount: ConstraintPriority, offset: Float = 0) -> ConstraintMakerFinalizable { + self.description.priority = amount.value + offset return self } diff --git a/Source/ConstraintPriority.swift b/Source/ConstraintPriority.swift index f5ff4f4..7299fa9 100644 --- a/Source/ConstraintPriority.swift +++ b/Source/ConstraintPriority.swift @@ -28,7 +28,7 @@ #endif -public struct ConstraintPriority : ExpressibleByFloatLiteral, Strideable, Equatable { +public struct ConstraintPriority : ExpressibleByFloatLiteral, Equatable { public typealias FloatLiteralType = Float public let value: Float @@ -62,14 +62,6 @@ public struct ConstraintPriority : ExpressibleByFloatLiteral, Strideable, Equata return 250.0 } - public func advanced(by n: Float) -> ConstraintPriority { - return ConstraintPriority(self.value + n) - } - - public func distance(to other: ConstraintPriority) -> Float { - return other.value - self.value - } - public static func ==(lhs: ConstraintPriority, rhs: ConstraintPriority) -> Bool { return lhs.value == rhs.value }