O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specializing Recognizer Messages

You can create a custom recognizer by subclassing UIGestureRecognizer and implementing one or more of the touch event handlers. You are also likely to implement other methods from the superclass, as well as your own logic and state variables.

The recognizer has two main jobs: Keep the gestures state up to date and recognize your custom stroke and/or perform your custom behavior. The main event handler methods follow the sequence of a stroke:

Image touchesBegan:withEvent: is sent when the touches first occur—that is, when the user touches the screen.

touchesMoved:withEvent: is sent each time the user moves one or more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required