Chapter 7. Handling Touch Interactions and Events
With its touch interface, iPhone is all about direct interactivity with the user. As a result, it is not surprising that any iPhone Web app you create can handle the variety of gestures — finger taps, flicks, swipes, and pinches — that a user naturally performs as they interact with your app on their mobile device.
The Three Types of Touch Events
There are three primary types of touch-related events to consider when developing an iPhone Web app. These include the following:
Mouse emulation events: Events in which a one- or two-finger action simulates a mouse.
Touch events: Events that dispatch when one or more fingers touch the screen. You can trap touch events and work with multiple finger touches that occur at different points on the screen at the same time.
Gesture events: Combinations of touch events that also support scaling and rotation information.
The mouse emulation events are the ones that you'll be working with for most purposes inside your Web app. As such, I'll spend most of my time ...