Chapter 4. Event Handling and Graphics Services
In Chapter 3, you were introduced to some of the basic user interface elements of the iPhone. Many objects support high-level events such as buttonClicked and tableRowSelected 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 basic mouse events that occur when the user taps or drags on the iPhone's screen. These methods are incorporated into other events created in UIView to detect two-fingered gestures. Higher-level objects, such as tables and alert sheets, take these low-level events and wrap them into even higher-level ones to handle button clicks, row selection, and other types of behavior. All such screen-oriented events are processed using the Graphics Services framework, which provides screen coordinates, fingering information, and other data related to the graphics of the event. These functions tell the application exactly what has occurred on the screen and provide the information needed 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 ...
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