Saturday, July 23, 2011

Detect Single/Double/Triple Taps In IPhone

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *urtouch = [touches anyObject];

NSUInteger urtapCount = [urtouch tapCount];

switch (urtapCount) {
case 1:
NSLog(@"Single Tap Detected!");
break;

case 2:
NSLog(@"Double Tap Detected!");
break;

case 3:
NSLog(@"Triple Tap Detected!");
break;

default :
break;
}
}

No comments: