Darren Findlay
Darren Findlay

Reputation: 2563

app starts ignores user interaction events when i call animateWithDuration:delay:options:animations:completion:

I have a button that glows in my app (subclass of UIButton). To animate the glowing i use the following method

- (void)glow
{

    [UIView animateWithDuration:1.0f 
                          delay:0.0f 
                        options:UIViewAnimationOptionCurveEaseInOut 
                     animations:^(void){

                         if (glowingImageView_.alpha != 1.0f) {
                             [glowingImageView_ setAlpha:1.0f];
                         }
                         else {
                             [glowingImageView_ setAlpha:0.3f];
                         }

                     } 
                     completion:^(BOOL finnished){

                         if (on_) {
                             [self glow];
                         }

                     }];

}

It works fine running on iOS 5, but in iOS 4.3 my app stops handling any user interaction. Any one have any idea what might be causing this?

Thanks

Upvotes: 0

Views: 1067

Answers (1)

Richard J. Ross III
Richard J. Ross III

Reputation: 55533

According to the UIView Docs:

During an animation, user interactions are temporarily disabled for the views being animated. (Prior to iOS 5, user interactions are disabled for the entire application.) If you want users to be able to interact with the views, include the UIViewAnimationOptionAllowUserInteraction constant in the options parameter.

So in iOS 4.3, user interactions were disabled. Thats your problem.

Upvotes: 6

Related Questions