UIControl Classes
Cocoa Touch provides a robust set of user interface controls that
can be used in iPhone and iPod Touch applications. The controls included in UIKit
help
ensure consistency across applications by establishing and conforming to a
set of defined interaction patterns.
Leveraging familiar interaction patterns in your applications can increase
usability by reducing the burden of learning the intricacies of a new
application. For lightweight, task-oriented mobile applications, a shallow
learning curve allows users to find value quickly.
User interface elements can be split into two main categories: those that accept user input and those that do not. Elements that respond to user input are called controls. Examples of controls are buttons, sliders, and switches. Non-control elements include activity indicators and status bars.
Standard controls are descendants of UIControl
and implement a special mechanism for sending messages in response to user
interaction. As with many standardized aspects of Cocoa, this allows
developers to rapidly evolve their application, changing the types of
controls on the screen or altering the backend code that responds to user
interaction.
The UIControl
class is the foundation for all of
the standard buttons, switches, and sliders. Figure 7-6 shows the UIControl
class
tree.
Figure 7-6. The UIControl class tree
The Target-Action Mechanism
Get Programming the iPhone User Experience now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.