Skip to Main Content
iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch
book

iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

by Maher Ali
March 2009
Beginner to intermediate content levelBeginner to intermediate
396 pages
8h 44m
English
Wiley
Content preview from iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

Chapter 5. Controls

Controls are graphical objects used by the user of the application to express his/her objective. For example, a slider control can be used by the user as a way to fine tune a specific value. A switch control, on the other hand, can be used to turn on/off an option. In this chapter, we present several important graphical controls that can be used in building attractive iPhone applications.

We will cover the main graphical controls available, and their usage. Before we begin talking about specialized controls, let's understand the base class for all controls, UIControl, and the important target-action mechanism.

The Foundation of All Controls

Controls are subclasses of the UIControl class. The UIControl class position in the class hierarchy is shown in Fig. 5.1. The common behavior of controls is captured by this class. Therefore, understanding this class is essential to using its concrete subclasses such as UITextField, UISlider, UIDatePicker, etc.

UIControl attributes

As a superclass of controls, the UIControl class has several shared attributes that can be configured using accessor methods. These attributes include:

  • enabled. This is a Boolean attribute that represents whether the control is enabled or not. The property is defined as:

    @property(nonatomic, getter=isEnabled) BOOL enabled

    If the value for enabled is NO, the user's touch events are ignored.

  • highlighted. This Boolean value controls whether the control is highlighted or not. By default, the value is NO. When ...

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.
Start your free trial

You might also like

Microsoft® Office Access 2007 on Demand

Microsoft® Office Access 2007 on Demand

Steve Johnson - Perspection, Inc.
FileMaker Pro 14: The Missing Manual

FileMaker Pro 14: The Missing Manual

Stuart Gripman, Susan Prosser
Microsoft® Office Access™ 2007 Step by Step

Microsoft® Office Access™ 2007 Step by Step

Steve Lambert Joan Lambert and M. Dow Lambert III

Publisher Resources

ISBN: 9780470742822Purchase book