How to disable multitouch?

Posted by cannyboy on Stack Overflow See other posts from Stack Overflow or by cannyboy
Published on 2009-07-03T16:26:02Z Indexed on 2010/05/24 12:11 UTC
Read the original article Hit count: 360

Filed under:
|
|

My app has several buttons which trigger different events. The user should NOT be able to hold down several buttons. Anyhow, holding down several buttons crashes the app.

And so, I'm trying to disable multi-touch in my app.

I've unchecked 'Multiple Touch' in all the xib files, and as far as I can work out, the properties 'multipleTouchEnabled' and 'exclusiveTouch' control whether the view uses multitouch. So in my applicationDidFinishLaunching I've put this:

self.mainViewController.view.multipleTouchEnabled=NO;
self.mainViewController.view.exclusiveTouch =YES;

And in each of my view controllers I've put this in the viewDidLoad

self.view.multipleTouchEnabled=NO;
self.view.exclusiveTouch=YES;

However, it still accepts multiple touches. I could do something like disable other buttons after getting a touch down event, but this would be an ugly hack. Surely there is a way to properly disable multi-touch?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview