diff --git a/Source/ConstraintMakerEditable.swift b/Source/ConstraintMakerEditable.swift index dcccdf1..8c125e5 100644 --- a/Source/ConstraintMakerEditable.swift +++ b/Source/ConstraintMakerEditable.swift @@ -30,20 +30,24 @@ public class ConstraintMakerEditable: ConstraintMakerPriortizable { + @discardableResult public func multipliedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { self.description.multiplier = amount return self } + @discardableResult public func dividedBy(_ amount: ConstraintMultiplierTarget) -> ConstraintMakerEditable { return self.multipliedBy(1.0 / amount.constraintMultiplierTargetValue) } + @discardableResult public func offset(_ amount: ConstraintOffsetTarget) -> ConstraintMakerEditable { self.description.constant = amount return self } + @discardableResult public func inset(_ amount: ConstraintInsetTarget) -> ConstraintMakerEditable { let insets: ConstraintInsets diff --git a/Source/ConstraintMakerPriortizable.swift b/Source/ConstraintMakerPriortizable.swift index 355faef..9616a38 100644 --- a/Source/ConstraintMakerPriortizable.swift +++ b/Source/ConstraintMakerPriortizable.swift @@ -30,19 +30,23 @@ public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { + @discardableResult public func priority(_ amount: ConstraintPriorityTarget) -> ConstraintMakerFinalizable { self.description.priority = amount return self } + @discardableResult public func priorityRequired() -> ConstraintMakerFinalizable { return self.priority(1000) } + @discardableResult public func priorityHigh() -> ConstraintMakerFinalizable { return self.priority(750) } + @discardableResult public func priorityMedium() -> ConstraintMakerFinalizable { #if os(iOS) || os(tvOS) return self.priority(500) @@ -51,6 +55,7 @@ public class ConstraintMakerPriortizable: ConstraintMakerFinalizable { #endif } + @discardableResult public func priorityLow() -> ConstraintMakerFinalizable { return self.priority(250) } diff --git a/Source/ConstraintMakerRelatable.swift b/Source/ConstraintMakerRelatable.swift index c0ba2c9..bab6369 100644 --- a/Source/ConstraintMakerRelatable.swift +++ b/Source/ConstraintMakerRelatable.swift @@ -67,14 +67,17 @@ public class ConstraintMakerRelatable { return editable } + @discardableResult public func equalTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { return self.relatedTo(other, relation: .equal, file: file, line: line) } + @discardableResult public func lessThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable { return self.relatedTo(other, relation: .lessThanOrEqual, file: file, line: line) } + @discardableResult public func greaterThanOrEqualTo(_ other: ConstraintRelatableTarget, _ file: String = #file, line: UInt = #line) -> ConstraintMakerEditable { return self.relatedTo(other, relation: .greaterThanOrEqual, file: file, line: line) }