I am trying to detect two finger touch on a UIImageView object. In xib I had set multi-touch enbled.
Then I implemented the following code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
//NSLog(@"%@", [[touches anyObject] class]);
UITouch* touch = [touches anyObject];
NSLog(@"%@", [touch class]);
if ([touches count] > 1)
NSLog(@"multi touches: %d fingers", [touches count]);
NSUInteger numTaps = [touch tapCount];
if (numTaps == 1) {
NSLog(@"single tap");
} else {
NSLog(@"multi tap: %d", numTaps);
}
}
What actually happning with this code is: This is detecting multiple taps not multi-touch. How can I detect that user touched on object with two finger(Multi-Touch).
Thanks
Use gestureRecognizers like this:
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html