O'Reilly logo

Beginning iPad™ Application Development by Wei-Meng Lee

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

Chapter 12. Recognizing Gestures

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to use the six gesture recognizers to recognize commonly used gestures

  • How to detect touches in your application

  • How to differentiate between single and double taps

  • How to implement the pinch gesture

  • How to implement the drag gesture

One of the most important selling points of the iPad is its screen, which can detect multiple points of input. Multi-touch inputs allow for very natural interaction between users and your applications. Because of multi-touch, the mobile Safari Web browser is easily one of the most user-friendly Web browsers available on a smart phone. The iPad recognizes various multi-touch sequences, known as gestures, and performs the appropriate action associated with each.

In this chapter, you learn how to recognize gestures in your application and then implement some cool features that improve the interaction between the user and the application, such as a jigsaw puzzle application. By detecting touches, your application enables the user to rearrange the locations of the images on the screen, as well as change the size of the images using the pinching gesture.

RECOGNIZING GESTURES

iPhone SDK 3.2 introduces a new set of classes known as gesture recognizers. Gesture recognizers allow you to easily detect for gestures performed by the user. For example, the user may use two fingers to pinch the screen, indicating his intention to zoom in and out of an image. Instead of writing the code to detect the ...

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