While my application runs a brief animation, I don’t want the user to be able to click on anything. In my view controller I can use
self.view.userInteractionEnabled = NO;
to block most interaction, but it doesn’t prevent the buttons in the toolbar/navbar from firing events.
I can’t just disable the buttons, since this has a distracting visual impact (the buttons are grayed out).
How might I briefly suspend interaction with ALL of the controls?
Use
-beginIgnoringInteractionEventsand-endIgnoringInteractionEventson your instance ofUIApplication. This is exactly what classes likeUINavigationControllerdo when animating a push to a new view controller. To get your particular instance ofUIApplication, use the+sharedApplicationmethod on theUIApplicationclass. Consider this example.