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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:37:58+00:00 2026-05-15T20:37:58+00:00

I have connected the two methods below to separate buttons in my UI but

  • 0

I have connected the two methods below to separate buttons in my UI but have noticed that after pressing the “VERSION 1” button that I could not press the button again until the animation duration within the method had ended. My understanding was that the animation uses its own thread so as not to block the main application.

// VERSION 1
-(IBAction)fadeUsingBlock {
    NSLog(@"V1: Clicked ...");
    [myLabel setAlpha:1.0];
    [UIView animateWithDuration:1.5 animations:^{
        [myLabel setAlpha:0.0];
    }];
}

The older style version (below) does allow the button to be repressed before the animation timer ends, simply resetting the timer to start again. Should these both work the same, am I missing something or has there been a change in operation between 3.2 and 4?

// VERSION 2
-(IBAction)fadeUsingOld {
    NSLog(@"V2: Clicked ...");
    [myLabel setAlpha:1.0];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.5];
    [myLabel setAlpha:0.0];
    [UIView commitAnimations];
}

Cheers gary

  • 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-15T20:37:58+00:00Added an answer on May 15, 2026 at 8:37 pm

    Animating with blocks doesn’t block the main thread. I think the behavior you’re seeing is because, by default, user interaction is disabled duration animation with the new block calls. You can override this by passing UIViewAnimationOptionAllowUserInteraction (calling animationWithDuration:delay:options:animations:completion), like this:

    -(IBAction) fadeUsingBlock {
        NSLog(@"V1: Clicked ...");
        [myLabel setAlpha:1.0];
        [UIView animateWithDuration:1.5 
                              delay:0
                            options:UIViewAnimationOptionAllowUserInteraction
                         animations:^{
                             [myLabel setAlpha:0.0];
                         }
                         completion:nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two problems that have bugged me for hours. connected/2 is supposed to
I have two keyboards connected to my PC, is there any way to know
I have two different-sized monitors, connected together using (I believe) TwinView. I tried System.out.println(Toolkit.getDefaultToolkit().getScreenSize());
Say I have two classes: Supplier, and Account. These classes are connected via has_one
I have two TDBLookupComboBox controls that I'd like to connect to the same dataset,
I have connected with the database successfully by using wizard in server explorer. but
I have a WCF web service that exposes several business methods. I also have
I ran into the problem that two drives connected at nearly the same time
I have two tables: fund and items. Items has a field called fundID that
I have two UIViews, each with their own separate renderBuffers and frameBuffers. They belong

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.