I Know filtering oneTap/doubleTap using a Apple API. code are follows.
UITapGestureRecognizer *doubleTapGestureRecognizer = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(handleDoubleTap:)];
doubleTapGestureRecognizer.numberOfTapsRequired = 2;
[self addGestureRecognizer:doubleTapGestureRecognizer];
UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
singleTapGestureRecognizer.numberOfTapsRequired = 1;
**[singleTapGestureRecognizer requireGestureRecognizerToFail: doubleTapGestureRecognizer];**
[self addGestureRecognizer:singleTapGestureRecognizer];
but oneTap/doubleTap checkDelayTime is feeling a so Long (About 0.5sec?).
Generally App Users of the reaction is very fast. Although 0.5 seconds is typically short-time. but In Mobile Device Environment is long-time, because users react is very important.
Speaking to the point, YouTubeApp have a very Perfectly algorithm about filtering at a moment oneTap/doubleTap. oneTap-doubleTap checkDelay is VeryVeryShort Perfectly Optimization.
oneTap(show/hidden controlBar)
doubleTap(full/default videoScreenSize)
How to implement like YoutubeApp? about oneTap-doubleTap filtering Not Using a requireGestureRecognizerToFail Selector. about very short delay oneTap-doubleTap distinguishing.
I think YoutubeApp is Not Use a requireGestureRecognizer Selector.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…