Double-tap or two single-taps?
Posted
by Jaka Jancar
on Stack Overflow
See other posts from Stack Overflow
or by Jaka Jancar
Published on 2009-08-15T18:26:37Z
Indexed on
2010/05/24
22:51 UTC
Read the original article
Hit count: 300
iphone
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).
© Stack Overflow or respective owner