Rightpoint / RZViewActions

A category on UIView that provides animation structure similar to SKAction from SpriteKit.
Other
103 stars 13 forks source link

How to stop all ongoing animation? #13

Closed kamarshad closed 8 years ago

kamarshad commented 8 years ago

Hello, I have gone through the tutorial(http://www.raizlabs.com/dev/2015/01/uiview-animation-sequencing-and-grouping-techniques/#comment-11772), love the way to you explained the keyframe animation specially by giving a demo app and explained it in a very simpler way :) . I have a question regarding the attached sample application. How to stop ongoing animation? let suppose animation started (title animation, tap label activity indicator, and copy right label animation).As it takes time to get it done completely and in-between If I want to stop this ongoing animation group it should stopped immediately and once that animation stopped all subviews(title label,tap label and copy right)should be in their right places.

jvisenti commented 8 years ago

Hi @kamarshad, because this library is built on the UIView block animation API, there is no way to explicitly cancel an animation, short of enumerating the animationKeys of each involved view's layer and canceling those. Even then, the views would jump to their final states rather than remaining in the presentation state when the animations were removed.

I think this would be a difficult problem even dropping down the the CAAnimation API, but if you know of a way to implement it, I think it would be a great feature.

jvisenti commented 8 years ago

I'm implementing the ability to cancel in-flight sequences in #14

kamarshad commented 8 years ago

@jvisenti Thanks :+1:

jvisenti commented 8 years ago

Implemented in v0.4.0