mirror of https://github.com/SnapKit/SnapKit
add @available to ConstraintLayoutGuide extension (#357)
* add @available to ConstraintLayoutGuide extension * Modify #available
This commit is contained in:
parent
17ed35c412
commit
6312572419
|
@ -31,6 +31,7 @@
|
|||
public protocol LayoutConstraintItem: class {
|
||||
}
|
||||
|
||||
@available(iOS 9.0, *)
|
||||
extension ConstraintLayoutGuide : LayoutConstraintItem {
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ class SnapKitTests: XCTestCase {
|
|||
|
||||
func testGuideMakeConstraints() {
|
||||
let v1 = View()
|
||||
if #available(iOS 9.0, *) {
|
||||
let g1 = UILayoutGuide()
|
||||
|
||||
self.container.addSubview(v1)
|
||||
self.container.addLayoutGuide(g1)
|
||||
|
||||
|
@ -81,6 +81,11 @@ class SnapKitTests: XCTestCase {
|
|||
}
|
||||
|
||||
XCTAssertEqual(self.container.snp_constraints.count, 6, "Should have 6 constraints installed")
|
||||
|
||||
} else {
|
||||
XCTAssertTrue(true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func testMakeImpliedSuperviewConstraints() {
|
||||
|
|
Loading…
Reference in New Issue