Touch Input: The Basics

There are really three ways to accept touch input from the user. The first is to use buttons or other prebuilt widgets and implement tasks that respond to the user events. I am not going to go through the details of this type of input, as it is the most basic, and is well covered in all iOS introductory books. The second method is to create subclasses of UIView and implement a number of touch-related tasks. The last technique is to wire up one of the six UIGestureRecognizer classes to a UIView and register an object to respond to the different gestures.

I think the last technique is the most robust in most cases, because it provides a way for users to interact with your application using a set of known gestures. However, ...

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.