Kaynağa Gözat

Fix build for previous sdk versions

Pavel Mazurin 11 yıl önce
ebeveyn
işleme
c3b4502cde

+ 1 - 1
Masonry/MASCompositeConstraint.m

@@ -162,7 +162,7 @@
     }
     }
 }
 }
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 - (void)activate
 - (void)activate
 {
 {
     for (MASConstraint *constraint in self.childConstraints) {
     for (MASConstraint *constraint in self.childConstraints) {

+ 1 - 1
Masonry/MASConstraint.h

@@ -182,7 +182,7 @@
  */
  */
 - (void)uninstall;
 - (void)uninstall;
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 /**
 /**
  *  Activates an NSLayoutConstraint.
  *  Activates an NSLayoutConstraint.
  */
  */

+ 1 - 1
Masonry/MASConstraint.m

@@ -238,7 +238,7 @@
 
 
 - (void)uninstall { MASMethodNotImplemented(); }
 - (void)uninstall { MASMethodNotImplemented(); }
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 - (void)activate { MASMethodNotImplemented(); }
 - (void)activate { MASMethodNotImplemented(); }
 
 
 - (void)deactivate { MASMethodNotImplemented(); }
 - (void)deactivate { MASMethodNotImplemented(); }

+ 1 - 1
Masonry/MASViewConstraint.m

@@ -354,7 +354,7 @@ static char kInstalledConstraintsKey;
     [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
     [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
 }
 }
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 - (void)activate
 - (void)activate
 {
 {
     NSAssert(self.hasBeenInstalled, @"Can't activate constraint that is not installed yet.");
     NSAssert(self.hasBeenInstalled, @"Can't activate constraint that is not installed yet.");

+ 1 - 1
Tests/Specs/MASCompositeConstraintSpec.m

@@ -152,7 +152,7 @@ SpecBegin(MASCompositeConstraint) {
     expect(superview.constraints).to.haveCountOf(0);
     expect(superview.constraints).to.haveCountOf(0);
 }
 }
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 - (void)testActivateDeactivate
 - (void)testActivateDeactivate
 {
 {
     NSArray *children = @[
     NSArray *children = @[

+ 1 - 1
Tests/Specs/MASViewConstraintSpec.m

@@ -509,7 +509,7 @@ SpecBegin(MASViewConstraint) {
     expect(superview.constraints).to.haveCountOf(0);
     expect(superview.constraints).to.haveCountOf(0);
 }
 }
 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
+#if defined(__IPHONE_8_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 - (void)testDeactivateConstraint {
 - (void)testDeactivateConstraint {
     MASViewAttribute *secondViewAttribute = otherView.mas_height;
     MASViewAttribute *secondViewAttribute = otherView.mas_height;
     constraint.equalTo(secondViewAttribute);
     constraint.equalTo(secondViewAttribute);