Skip to Main Content
Beginning iOS 4 Application Development
book

Beginning iOS 4 Application Development

by Wei-Meng Lee
October 2010
Beginner content levelBeginner
655 pages
14h 9m
English
Wrox
Content preview from Beginning iOS 4 Application Development

Chapter 14. 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 iPhone 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 iPhone 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 users to rearrange the locations of the onscreen images, as well as change the size of the images using the pinching gesture.

Recognizing Gestures

Beginning with version 3.2 of the iPhone SDK, Apple introduced a new set of classes known as gesture recognizers. Gesture recognizers enable you to easily detect gestures performed by the user. For example, the user may use two fingers to pinch the screen, indicating an intention to zoom in and out of an image. Instead of writing ...

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.
Start your free trial

You might also like

Beginning iOS 5 Application Development

Beginning iOS 5 Application Development

Wei-Meng Lee

Publisher Resources

ISBN: 9780470918029Purchase book