mirror of https://github.com/SnapKit/SnapKit
Tweak priority API's for offseting
This commit is contained in:
parent
681dfcbc3a
commit
e17ecbfde8
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue