19 UIGestureRecognizer and UIMenuController
In Chapter 18, you handled raw touches 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 calls a method on the object of your choice. There are several types of gesture recognizers built into the SDK. In this chapter, you will use three of them to allow TouchTracker users to select, move, and delete lines (Figure 19.1). You will also see how to use another ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access