For the More Curious: More on UIGestureRecognizer

We’ve only scratched the surface of UIGestureRecognizer; there are more subclasses, more properties, and more delegate methods, and you can even create recognizers of your own. This section will give you an idea of what UIGestureRecognizer is capable of, and then you can study the documentation for UIGestureRecognizer to learn even more.

When a gesture recognizer is on a view, it is really handling all of the UIResponder methods, like touchesBegan:withEvent:, for you. Gesture recognizers are pretty greedy, so they typically don’t let a view receive touch events or they at least delay the delivery of those events. You can set properties on the recognizer, like delaysTouchesBegan, delaysTouchesEnded ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.