Ver código fonte

Remove ifdefs. Update codestyle.

Pavel Mazurin 10 anos atrás
pai
commit
cf35f1fe41

+ 4 - 12
Masonry/MASViewConstraint.m

@@ -109,12 +109,10 @@ static char kInstalledConstraintsKey;
 
 
 - (BOOL)isActive {
 - (BOOL)isActive {
     BOOL active = YES;
     BOOL active = YES;
-#ifdef __IPHONE_8_0
-    if ([self supportsActiveProperty])
-    {
+    if ([self supportsActiveProperty]) {
         active = [self.layoutConstraint isActive];
         active = [self.layoutConstraint isActive];
     }
     }
-#endif
+
     return active;
     return active;
 }
 }
 
 
@@ -289,28 +287,22 @@ static char kInstalledConstraintsKey;
 #pragma mark - MASConstraint
 #pragma mark - MASConstraint
 
 
 - (void)activate {
 - (void)activate {
-#if defined(__IPHONE_8_0)
     if ([self supportsActiveProperty] && self.layoutConstraint) {
     if ([self supportsActiveProperty] && self.layoutConstraint) {
         if (self.hasBeenInstalled) {
         if (self.hasBeenInstalled) {
             return;
             return;
         }
         }
         self.layoutConstraint.active = YES;
         self.layoutConstraint.active = YES;
         [self.firstViewAttribute.view.mas_installedConstraints addObject:self];
         [self.firstViewAttribute.view.mas_installedConstraints addObject:self];
-    } else
-#endif
-    {
+    } else {
         [self install];
         [self install];
     }
     }
 }
 }
 
 
 - (void)deactivate {
 - (void)deactivate {
-#if defined(__IPHONE_8_0)
     if ([self.layoutConstraint respondsToSelector:@selector(setActive:)]) {
     if ([self.layoutConstraint respondsToSelector:@selector(setActive:)]) {
         self.layoutConstraint.active = NO;
         self.layoutConstraint.active = NO;
         [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
         [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
-    } else
-#endif
-    {
+    } else {
         [self uninstall];
         [self uninstall];
     }
     }
 }
 }

+ 1 - 2
Tests/Specs/MASCompositeConstraintSpec.m

@@ -152,8 +152,7 @@ SpecBegin(MASCompositeConstraint) {
     expect(superview.constraints).to.haveCountOf(0);
     expect(superview.constraints).to.haveCountOf(0);
 }
 }
 
 
-- (void)testActivateDeactivate
-{
+- (void)testActivateDeactivate {
     NSArray *children = @[
     NSArray *children = @[
                           [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_leading],
                           [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_leading],
                           [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_trailing]
                           [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_trailing]