Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit d3a8f44

Browse files
Merge pull request #404 from facebook/textnode-tapping
Allow double-tap gestures on text nodes
2 parents dd10fda + 29a360d commit d3a8f44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

AsyncDisplayKit/ASControlNode.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
196196
{
197197
// If we're interested in touches, this is a tap (the only gesture we care about) and passed -hitTest for us, then no, you may not begin. Sir.
198198
if (self.enabled && [gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] && gestureRecognizer.view != self.view) {
199-
return NO;
199+
UITapGestureRecognizer *tapRecognizer = (UITapGestureRecognizer *)gestureRecognizer;
200+
// Allow double-tap gestures
201+
return tapRecognizer.numberOfTapsRequired != 1;
200202
}
201203

202204
// Otherwise, go ahead. :]

0 commit comments

Comments
 (0)