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

  • Home
  • SEARCH
  • 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 an app in java that is nothing but a remote server.The remote
I have an application that needs to scan for bluetooth devices every 10 minutes
I have written a linux daemon that will be (and must be) running as
After asking so many question about android socket programming and getting valuable answers from
In my community, every user should only have one account. So I need a
Possible Duplicate: Android How to draw a smooth line following your finger I'm new
I am trying to ping a Socomec meter using the Modbus protocol, having researched,
How can we create 2 table views in a single view without using section
I'm experiencing an issue managing threads on .Net 4.0 C#, and my knowledge of
I'm making an Android app where the user can download files from a FTP-server.

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.