objective c - How can I cancel and animation started with transitionFromView:toView:duration:options:completion? -


how can cancel , animation started transitionfromview:toview:duration:options:completion? want, avoid calling completation block if animation cancelled, because thatblock transitates state machine.

i guess possible cancel animation because here: https://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html read this: completion block object executed when animation sequence ends. block has no return value , takes single boolean argument indicates whether or not animations finished before completion handler called.

therfore, how can cancel animation? lot.

it layer of fromview's superview animates in scenario. can cancel animation @ time with

[parentview.layer removeallanimations]; 

your completion callback still called, keep in mind that, you've quoted above, callback takes bool argument indicating whether animation completed or not. check argument , nothing if it's no.

visually, animation jumps end. you'll see toview active interface. in fact, toview present within superview, beginning of animation; covered layer's presentationlayer during animation.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -