What is the time limit for two taps to be considered a double-tap, on the iPhone OS?
// Edit: Why is this important?
In order to handle single-tap and double-tap differently, Apple's guide says to do performSelector...afterDelay
with some 'reasonable' interval on first tap (and cancel it later if the second tap is detected).
The problem is that if the interval is too short (0.1), the single tap action will be performed even when double-tapping (if relying only on tapCount, that is). If it's too long (0.8), the user will be waiting unnecessarily for the single-tap to be recognized, when there is no possibility for a double-tap.
It has to be exactly the correct number, in order to work optimally, but definitely not smaller, or there's a chance for bugs (simultaneous single-tap and double-tap).
Instruction and practice of the double-tap improves overall accuracy as shooters often do not have the gun fully extended on the first shot meaning the second of a double-tap is usually the better.
“Double tap” is another way to refer to “liking” a post, especially on Instagram, where double tapping an image is the method for “liking” it. Sometimes brands invite followers to “double tap” their post in order to increase engagement.
The term “double tap” became especially popular in general parlance following its usage in the film Zombieland, in which it referred to the practice of ensuring a zombie was dead by shooting or striking its head a second time.
You can double-tap or triple-tap the back of iPhone to perform actions such as taking a screenshot, turning on an accessibility feature, running a shortcut, and more. Go to Settings > Accessibility > Touch > Back Tap. Choose Double Tap or Triple Tap, then choose an action.
You can detect any number of tap by the tap gesture. No need of playing with NSTouches
either. For all the user seeking for the solution here it is.
These simple lines of code does the duty of single and double tap functionality.
UITapGestureRecognizer *doubleTapRecg = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(doubleTapped:)];
doubleTapRecg.delegate = self;
doubleTapRecg.numberOfTapsRequired = 2;
doubleTapRecg.numberOfTouchesRequired = 1;
[view addGestureRecognizer:doubleTapRecg];
UITapGestureRecognizer *tapRecg = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(tapped:)];
tapRecg.delegate = self;
tapRecg.numberOfTapsRequired = 1;
tapRecg.numberOfTouchesRequired = 1;
[view addGestureRecognizer:tapRecg];
[tapRecg requireGestureRecognizerToFail:doubleTapRecg];
[doubleTapRecg release];
[tapRecg release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With