iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
22. Gesture Recognizers
What if an app needed a quick and easy way to handle taps, swipes, pinches, and rotations? Back in the Dark Ages (before the iPad was released), a developer had to subclass UIView, implement the touchesBegan:/touchesMoved:/touchesEnded: methods, and write custom logic to determine when any of these actions was taking place. It could take all day!
Apple introduced UIGestureRecognizers to address this need with iOS 3.2 when the original iPad was released. UIGestureRecognizer is an abstract class that puts a common architecture around handling gestures. There are several concrete implementations to handle the everyday gestures that are commonly used, and even subclassing guidelines to create your own gestures using the same ...
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