Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming
by Maurice Sharp, Erica Sadun, Rod Strougo
Gesture Recognizer Basics
From tapping buttons to moving a slider, many built-in interface elements implement their own gestures. But sometimes you need to do something different: swipe through cars, give a quick gesture to reset state, or move a view to a new destination. All these gestures are easy to implement using UIGestureRecognizer and related classes.
UIGestureRecognizer is an abstract superclass and encapsulates the properties and behaviors that are common to any recognizer: what view the recognizer is attached to, whether it is enabled, where the touch is happening, how many fingers are on the screen, and so on. Built-in recognizers as well as your own custom ones are all based on the abstract one.
Recognizers have a few common attributes. ...
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