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 3751866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:08:05+00:00 2026-05-19T09:08:05+00:00

Hi in response to touch events, my application does view animation. If the user

  • 0

Hi in response to touch events, my application does view animation. If the user is really fast and does another touch even while the current animation is happening then everything gets messed up.

Is there a standard way to handle this problem provided by the framework? Or am I doing the animation in a wrong way?

Currently it is checking a flag (animationInProgress) to handle this but I wanted to know if that is what we have to resort to for this?

Here is the code:

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
    NSMutableArray *c = (NSMutableArray*)context;
    UINavigationController *nc = [c objectAtIndex:0];
    [nc.view removeFromSuperview];
    animationInProgress = NO;
}

- (void)transitionViews:(BOOL)topToBottom {
    if (animationInProgress) {
        return;
    }
    animationInProgress = YES;
    NSMutableArray *context = [[NSMutableArray alloc] init];
    [UIView beginAnimations:@"myanim" context:context];
    [UIView setAnimationDuration:0.7f];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];

    UIViewController *from;
    UIViewController *to;
    if (navController3.view.superview == nil ) {
        from = navController2;
        to = navController3;
    } else {
        from = navController3;
        to = navController2;
    }

    int height;
    if (topToBottom) { 
        height = -1 * from.view.bounds.size.height;
    } else {
        height = from.view.bounds.size.height;
    }

    CGAffineTransform transform = from.view.transform;

    [UIView setAnimationsEnabled:NO];
    to.view.bounds = from.view.layer.bounds;
    to.view.transform = CGAffineTransformTranslate(transform, 0, height);
    [window addSubview:to.view];

    [UIView setAnimationsEnabled:YES];
    from.view.transform = CGAffineTransformTranslate(from.view.transform, 0, -1 * height);
    to.view.transform = transform;

    [context addObject:from];

    [UIView commitAnimations];

    return;
}
  • 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-19T09:08:06+00:00Added an answer on May 19, 2026 at 9:08 am

    The default behavior of the frameworks is, as you noticed, to allow anything to happen simultaneously if you want it to.

    Using a flag like you’re doing is perfectly reasonable if your goal is to block a specific animation from happening if it’s already running.

    If you want to go “up a level” conceptually and stop any touch events from entering your application at all during the animation, you can use:

    [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
    

    paired with a:

    [[UIApplication sharedApplication] endIgnoringInteractionEvents];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A response on SO got me thinking, does JavaScript guarantee a certain endian encoding
Based on the response to this question: Why does C++ have header files and
I'm writing an iPhone app which needs an extremely rapid response for a touch
When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers
In @mmalc's response to this question he states that In general you should not
Modifying the HTTP Response Using Filters
As a response to the recent Twitter hijackings and Jeff's post on Dictionary Attacks
I am storing the response to various rpc calls in a mysql table with
Every Hello has a response. Second TTY will send a hello to the sender
After I get response from httpwebrequest, I'd like the cookies obtained to save for

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.