...
|
...
|
@@ -22,6 +22,7 @@ |
|
|
@property (nonatomic, assign) CGFloat layoutConstant;
|
|
|
@property (nonatomic, assign) BOOL hasLayoutRelation;
|
|
|
@property (nonatomic, strong) id mas_key;
|
|
|
@property (nonatomic, assign) BOOL useAnimator;
|
|
|
|
|
|
@end
|
|
|
|
...
|
...
|
@@ -57,7 +58,16 @@ |
|
|
|
|
|
- (void)setLayoutConstant:(CGFloat)layoutConstant {
|
|
|
_layoutConstant = layoutConstant;
|
|
|
|
|
|
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
|
|
|
if(self.useAnimator) {
|
|
|
self.layoutConstraint.animator.constant = layoutConstant;
|
|
|
} else {
|
|
|
self.layoutConstraint.constant = layoutConstant;
|
|
|
}
|
|
|
#else
|
|
|
self.layoutConstraint.constant = layoutConstant;
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
- (void)setLayoutRelation:(NSLayoutRelation)layoutRelation {
|
...
|
...
|
@@ -247,6 +257,17 @@ |
|
|
return self;
|
|
|
}
|
|
|
|
|
|
#pragma mark - Animator proxy
|
|
|
|
|
|
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
|
|
|
|
|
|
- (id<MASConstraint>)animator {
|
|
|
self.useAnimator = YES;
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#pragma mark - debug helpers
|
|
|
|
|
|
- (id<MASConstraint> (^)(id))key {
|
...
|
...
|
|