Add this after the code:
NSLog(@"imageView.gestureRecognizers: %@", [imageView.gestureRecognizers description]);
If you correctly added gestureRecognizers, it will print a description of each of them on the console. If not, the console will display (NULL) or an empty array.
You can also set the gesture recognizer delegate:
[singleFingerTap setDelegate:self]
Then add a delegate method and set a breakpoint to make sure it is called:
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { NSLog(@"gestureRecognizerShouldBegin: called"); return YES; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { NSLog(@"shouldReceiveTouch: called"); return YES; }
chown source share