Home

Objective-C Quick Tip: How to get the app to temporarily ignore touches

If you are working on a really cool or interesting animation in your Objective-C App, and you want to temporarily ignore any user touches, perhaps because it may interfere with the completion of an animation sequence, you can call an Application-level ignore instruction to ignore (and then un-ignore) touches, by simply doing:  

//Tell the App tos tart ignoring any touches
[[UIApplication sharedApplication] endIgnoringInteractionEvents];
...

//Tell the App to stop ignoring any touches
[[UIApplication sharedApplication] endIgnoringInteractionEvents];