Add back in equalToSuperview API

This commit is contained in:
Robert Payne 2016-09-10 16:31:28 +12:00
parent 2e4cebf41d
commit 9b1a0519ee
1 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,14 @@ public class ConstraintMakerRelatable {
return self.relatedTo(other, relation: .equal, file: file, line: line)
}
@discardableResult
public func equalToSuperview(_ file: String = #file, _ line: UInt = #line) -> ConstraintMakerEditable {
guard let other = self.description.view.superview else {
fatalError("Expected superview but found nil when attempting make constraint `equalToSuperview`.")
}
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)