Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added disableAnimator method so we can disable constraint animator proxy... #189

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Masonry/MASCompositeConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ - (MASConstraint *)animator {
return self;
}

- (void)disableAnimator {
for (MASConstraint *constraint in self.childConstraints) {
[constraint disableAnimator];
}
}

#endif

#pragma mark - debug helpers
Expand Down
5 changes: 5 additions & 0 deletions Masonry/MASConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
1 change: 1 addition & 0 deletions Masonry/MASConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions Masonry/MASViewConstraint.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ - (MASConstraint *)animator {
return self;
}

- (void)disableAnimator {
self.useAnimator = NO;
}

#endif

#pragma mark - debug helpers
Expand Down