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.
This framework is considered to be low-level, and has since been built on with the more user-friendly touches API and other frameworks. These low-level functions tell the application exactly what has occurred on the screen and provide the information needed to interact with the user. They appear to be used largely in Apple’s own preloaded applications. To receive many of these events, you’ll need to add the following function call to your application: ...
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