Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7607185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:35:53+00:00 2026-05-31T00:35:53+00:00

How can I cancel and animation started with transitionFromView:toView:duration:options:completion? Actually what I want, is

  • 0

How can I cancel and animation started with transitionFromView:toView:duration:options:completion?
Actually what I want, is to avoid calling the completation block if animation was cancelled, just because thatblock transitates a state machine.

I guess is possible to cancel the animation because here:
https://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html
I read this:
completion
A block object to be executed when the animation sequence ends. This block has no return value and takes a single Boolean argument that indicates whether or not the animations actually finished before the completion handler was called.

Therfore, how can I cancel the animation?
Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:35:54+00:00Added an answer on May 31, 2026 at 12:35 am

    It is the layer of the fromView’s superview that animates in this scenario. You can cancel the animation at any time with

    [parentView.layer removeAllAnimations];
    

    Your completion callback will still be called, but keep in mind that, as you’ve quoted above, the callback takes a BOOL argument indicating whether the animation completed or not. Just check the argument and do nothing if it’s NO.

    Visually, it will look like the animation just jumps to the end. You’ll see the toView as the active interface. In fact, the toView was already present within the superview, even from the beginning of the animation; it was just covered up by the layer’s presentationLayer during the animation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know how I can cancel a file upload with a form
I'm trying to figure out how I can listen to the Cancel button that
I have a cancel button on a page. But this page can be opened
Android Market app purchases have a 15-min grace period when a customer can cancel
I'm trying to implement multistage animation using UIViewAnimationOptionBeginFromCurrentState to allow the user to cancel
I have a cancel button where the user can cancel on a file upload
While working with dialogs in android one can cancel it or dismiss it, But
How can I cancel a promise without removing the element from the DOM? fiddle
The only functional difference I have encountered is that I can cancel the message
Is it possible to cancel a UIView animation while it is in progress? Or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.