How can I disable a UIButton from being pressed…
while I show a graphic for 5 seconds?
self.view.userInteractionEnabled = NO; // if you need the whole view disabled
//self.btn.enabled = NO; //if you need button only disabled
[UIView animateWithDuration:3.0f animations:^
{
// your graphical changes
[(UILabel*)addLbl[1] setBackgroundColor:[UIColor redColor]];
}
completion:^ (BOOL finished)
{
self.view.userInteractionEnabled = YES;
//self.button.enabled = YES;
[(UILabel*)addLbl[1] setBackgroundColor:[UIColor whiteColor]];
}
];
You can use the delay method: