What you do, you just set on / off outside the block. It is wrong to execute it after calling this method, so its not turning off the button until the completion block is called. Instead, you should reuse it after the animation is complete.
-(IBAction) buttonClick:(id)sender{ button.enabled = false; [UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionAllowAnimatedContent animations:^{ // code to execute } completion:^(BOOL finished){ // code to execute button.enabled = true; //This is correct. }]; //button.enabled = true; //This is wrong. }
Oh, yes, instead of true and false , YES and NO look good. :)
Hemang
source share