mirror of https://github.com/SnapKit/SnapKit
Add back in equalToSuperview API
This commit is contained in:
parent
2e4cebf41d
commit
9b1a0519ee
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue