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

Animating via constraint toggle? #1

Open
winstondu opened this issue Dec 13, 2019 · 0 comments
Open

Animating via constraint toggle? #1

winstondu opened this issue Dec 13, 2019 · 0 comments

Comments

@winstondu
Copy link

Currently, with UIView.animate, it is possible to do an animation through a constraint toggle.
For example, if we have an object rect, and we have two layout constraints on its location, constrainRectToTop and constrainRectToTop, we can do as follows:

UIView.animate(withDuration: 0.35, delay: 0.35, animations: {
                    self.constrainRectToTop.isActive = false
                    self.constrainRectToBottom.isActive = true
                    self.view.layoutIfNeeded()
                }

What would be a general way of accomplishing this using MotionMachine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant