views:

18

answers:

1

I have a UIButton that I disable for a few seconds after the user clicks it (using button.enabled = NO). The button disables, but touching it whilst disabled causes the view behind to receive the touch - something I don't want.

I've tried button.userInteractionEnabled = NO as well but this has the same problem.

Can I have the button consume the touch? Or do I have to keep it enabled and programatically halt code execution in the IBAction?

A: 

Don't disable it - just don't execute the method that is called on tap.
You might keep some boolean that will keep button's "virtual" state (active or not) and according to this boolean execute or don't execute the action...

Michael Kessler