This will help identify methods for single and double bends.
(void) handleSingleTap {} (void) handleDoubleTap {}
So then in touchesEnded you can call the appropriate method based on the number of taps, but only after the delay has gone beyond the handleSingleTap call to make sure that the double tap has not been executed:
-(void) touchesEnded(NSSet *)touches withEvent:(UIEvent *)event { if ([touch tapCount] == 1) { [self performSelector:@selector(handleSingleTap) withObject:nil afterDelay:0.3];
In touchesBegan cancel all requests for handleSingleTap so that the second answer cancels the first call to handleSingleTap and only handleDoubleTap will be called
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(handleSingleTap) object:nil];
source share