diff --git a/Masonry/MASCompositeConstraint.m b/Masonry/MASCompositeConstraint.m index ed63ed63..815a90db 100644 --- a/Masonry/MASCompositeConstraint.m +++ b/Masonry/MASCompositeConstraint.m @@ -106,6 +106,12 @@ - (MASConstraint *)animator { return self; } +- (void)disableAnimator { + for (MASConstraint *constraint in self.childConstraints) { + [constraint disableAnimator]; + } +} + #endif #pragma mark - debug helpers diff --git a/Masonry/MASConstraint.h b/Masonry/MASConstraint.h index 70a10c8e..55dc6273 100644 --- a/Masonry/MASConstraint.h +++ b/Masonry/MASConstraint.h @@ -190,6 +190,11 @@ * Whether or not to go through the animator proxy when modifying the constraint */ @property (nonatomic, copy, readonly) MASConstraint *animator; + +/** + * Disable use of the animator proxy. To re-enable, simply use the animator property again. + */ +- (void)disableAnimator; #endif /** diff --git a/Masonry/MASConstraint.m b/Masonry/MASConstraint.m index f24ec104..1e4d32aa 100644 --- a/Masonry/MASConstraint.m +++ b/Masonry/MASConstraint.m @@ -278,6 +278,7 @@ - (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); } #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) - (MASConstraint *)animator { MASMethodNotImplemented(); } +- (void)disableAnimator { MASMethodNotImplemented(); } #endif diff --git a/Masonry/MASViewConstraint.m b/Masonry/MASViewConstraint.m index e8ccdcb9..1df45ae4 100644 --- a/Masonry/MASViewConstraint.m +++ b/Masonry/MASViewConstraint.m @@ -218,6 +218,10 @@ - (MASConstraint *)animator { return self; } +- (void)disableAnimator { + self.useAnimator = NO; +} + #endif #pragma mark - debug helpers