I've two UITapGestureRecognizer
: singleTap
and doubleTap
initialized with two different actions.
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
[singleTap requireGestureRecognizerToFail:doubleTap];
[doubleTap setNumberOfTapsRequired:2];
[imageView addGestureRecognizer:doubleTap];
[imageView addGestureRecognizer:singleTap];
When I run my app in simulator the single tap responds correctly but not the double tap ! When I double clicks nothings happens, I suppose iOS dose recognize the double tap because the action of single tap doesn't being called (due to [singleTap requireGestureRecognizerToFail:doubleTap];
), but I can't understand why doesn't it do the action handleDoubleTap
.
setNumberOfTapsREquired
to 3 for doubleTap, and when I double click nothing happens neither ! It's stranger since in this case a double click should be recognized as a single click, right ? Double click issue with the iOS simulator perhaps ? – Grown