Chapter 4. Multi-Touch Events and Geometry
In Chapter 3, you were introduced to some of the iPhone’s basic user
interface elements. Many objects support high-level events to notify the
application of certain actions taken by the user. These actions rely on
lower-level mouse events provided by the UIView class and
a base class underneath it: UIResponder. The
UIResponder class provides methods to
recognize and handle the mouse events that occur when the user taps or
drags on the iPhone’s screen. Higher-level objects, such as tables and
action sheets, take these low-level events and wrap them into even
higher-level ones to handle button clicks, swipes, row selections, and
other types of behavior. Apple has provided a multi-touch API capable of
intercepting finger gestures in order to make the same use of finger
movements in your UI. The touches API tells the application exactly what has occurred on the
screen and provides the information the application needs to interact with
the user.
Introduction to Geometric Structures
Before diving into events management, you’ll need a basic understanding of some geometric structures commonly used on the iPhone. You’ve already seen some of these in Chapter 3. The Core Graphics framework provides many general structures to handle graphics-related functions. Among these structures are points, window sizes, and window regions. Core Graphics also provides many C-based functions for creating and comparing these structures.
CGPoint
A CGPoint is the simplest ...
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.
Read now
Unlock full access