/ Published in: Objective C
execute different functions on single or double tap
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
{ UITouch *touch = touches.anyObject; _dragStartPos = [touch locationInView:self]; /////////Logic To Handle Single and Double Tap //the the first tap delegate message if its a double tap and so on selector:@selector(singleTap) object:nil]; selector:@selector(doubleTap) object:nil]; //logic to get the tap count if(touches.count == 1) { if([[touches anyObject] tapCount] == 2) { [self performSelector:@selector(doubleTap) withObject:nil afterDelay:0.35]; } else if([[touches anyObject] tapCount] == 3) { [self trippleTap]; } else { [self performSelector:@selector(singleTap) withObject:nil afterDelay:0.35]; } } }