Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does touchesBegan not fire when the number of touches changes?

For some reason my touchesBegan method doesn't seem to be responding correctly. If I touch the screen with two fingers, then lift one up and put it down again, touchesBegan gets called correctly. If I touch the screen with one finger, then add a second finger, touchesBegan does not get called like it should. Is there some flag that I need to check? Below is a sample that illustrates my problem:

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
     NSLog(@"touch");
}

Any ideas what's going on? I'm testing on an iPad with iOS 4.2 if it matters.

like image 238
Davido Avatar asked Jan 20 '23 21:01

Davido


1 Answers

Yes, you need to set the multipleTouchEnabled property on your view.

When set to NO, the receiver receives only the first touch event in a multi-touch sequence. The default value of this property is NO.

like image 183
David Gelhar Avatar answered Feb 16 '23 04:02

David Gelhar