Authored by Pavel Mazurin

Remove ifdefs. Update codestyle.

... ... @@ -109,12 +109,10 @@ static char kInstalledConstraintsKey;
- (BOOL)isActive {
BOOL active = YES;
#ifdef __IPHONE_8_0
if ([self supportsActiveProperty])
{
if ([self supportsActiveProperty]) {
active = [self.layoutConstraint isActive];
}
#endif
return active;
}
... ... @@ -289,28 +287,22 @@ static char kInstalledConstraintsKey;
#pragma mark - MASConstraint
- (void)activate {
#if defined(__IPHONE_8_0)
if ([self supportsActiveProperty] && self.layoutConstraint) {
if (self.hasBeenInstalled) {
return;
}
self.layoutConstraint.active = YES;
[self.firstViewAttribute.view.mas_installedConstraints addObject:self];
} else
#endif
{
} else {
[self install];
}
}
- (void)deactivate {
#if defined(__IPHONE_8_0)
if ([self.layoutConstraint respondsToSelector:@selector(setActive:)]) {
self.layoutConstraint.active = NO;
[self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
} else
#endif
{
} else {
[self uninstall];
}
}
... ...
... ... @@ -152,8 +152,7 @@ SpecBegin(MASCompositeConstraint) {
expect(superview.constraints).to.haveCountOf(0);
}
- (void)testActivateDeactivate
{
- (void)testActivateDeactivate {
NSArray *children = @[
[[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_leading],
[[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_trailing]
... ...