- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
I am currently getting 1 object in
touches
when I do a tap with two fingers simultaneously (holding option key and clicking on the simulator). I believe this is because I haven't enabled the
multipleTouchEnabled
property of the attached view. I want to make it so that I don't register this event for multi-touches.
Looking into the issue, it seems like it would work if I enable multipleTouchEnabled, and then do
if ([touches count] > 1) {
return;
}
in my
touchesBegan:
However, this seems strange to me in that I am ENABLING multipleTouchEnabled to DISABLE multiple touches, and am worried if there will be side-effects. Is there a better way to solve my problem?
You should just be able to disable the multitouch property on the view , in IB you have to actually go over to the side panel and click on the thing that says view next to files owner to get it and then uncheck it, or you could do it in code in viewdidload:
self.view.multiTouchEnabled = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With