| 123456789101112131415161718192021222324252627282930 |
- //
- // NSLayoutConstraint+Additions.m
- // SmartCity
- //
- // Created by Jason Lee on 1/5/16.
- // Copyright © 2016 ntels. All rights reserved.
- //
- #import "NSLayoutConstraint+Additions.h"
- @implementation NSLayoutConstraint (Additions)
- - (NSLayoutConstraint *)setMutltiplier:(CGFloat)multiplier {
-
- NSLayoutConstraint *newConstraint = [NSLayoutConstraint constraintWithItem:self.firstItem attribute:self.firstAttribute relatedBy:self.relation toItem:self.secondItem attribute:self.secondAttribute multiplier:multiplier constant:self.constant];
-
- newConstraint.priority = self.priority;
- newConstraint.shouldBeArchived = self.shouldBeArchived;
- newConstraint.identifier = self.identifier;
- newConstraint.active = self.active;
-
- [NSLayoutConstraint deactivateConstraints:@[self]];
- [NSLayoutConstraint activateConstraints:@[newConstraint]];
-
- return newConstraint;
- }
- @end
|