In UIViewPropertyAnimator, is there a way to just stop all UIViewPropertyAnimator animations?
Or perhaps simply get all current animations - then of course you could stop them all.
Can this be done?
Or do you really have to
- (a) do only one per
UIViewPropertyAnimator,
and,
- (b) keep a reference to each of those?
Every animation has to have atleast one UIViewPropertyAnimator instance. In order to stop the animation, we have to explicitly call
stopAnimation(_:)on the animator instance.A way would be to make a factory class to fetch
UIViewPropertyAnimatorinstance and keep track of it in a set or array. And then use this factory class to stop or start all the animations at once. Or use oneUIViewPropertyAnimatorto perform all your animations and stop it.