Understanding Gesture Recognizers

iOS allows the user to interact with an application with a rich set of gestures. These include taps, swipes, pinches, and so on. Each of these gestures is comprised of some reasonably complex logic to interpret touch events into a cohesive gesture. If this was left up to each developer to implement, the user experience with be pretty bad, as each developer would inevitably make different assumptions about each gesture. For example, the long press gesture has a default duration. We would want this consistent across all applications, because we don’t want to “retrain” each user for each application as to what a long press is. In this spirit, Apple provides a number of classes that are designed to identify the most ...

Get Beginning iOS 5 Games Development: Using the iOS 5 SDK for iPad, iPhone, and iPod Touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.