Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Chapter 19, you handled raw touches and determined their course by implementing methods from UIResponder. Sometimes, you want to detect a specific pattern of touches that make a gesture, like a pinch or a swipe. Instead of writing code to detect common gestures yourself, you can use instances of UIGestureRecognizer.
A UIGestureRecognizer intercepts touches that are on their way to being handled by a view. When it recognizes a particular gesture, it sends a message to the object of your choice. There are several types of gesture recognizers built into the SDK. In this chapter, we will use three of them to allow TouchTracker users to select, move, and delete lines. We’ll also see how to use another interesting iOS class,