With all the buttons that come built into standard action sheets, toolbars, navigation bars, and tab bars, you're already awash in interface controls to trigger your app's features, but of course you're not limited to using only the buttons that come bundled in those containers. The iPhone toolkit gives developers the basic code to draw a button anywhere on the screen. Buttons can be styled however you like, from a plain text button to a richly graphical icon. The most basic style is the rounded rectangle button, a just-the-facts control with a text label inside.
Figure 5-36. Now Playing (left) uses lots of rounded rectangle buttons for finding out more about movies playing in your area. Yelp (right) uses the same basic buttons, shown here at screen bottom, to launch searches for nearby businesses.
These basic buttons get the job done, but let's face it: rounded rectangles are a little, um, square. Most apps use custom graphics to spiff up their buttons, at the very least adding a background image to give the button some texture or gloss. (You'll find pointers for creating some of these effects in Keep It Real.) No matter what style of button you use, you should create at least two looks for each button to reflect its control state. Buttons are in the normal state when they're just minding their own business, waiting for something to happen. Buttons are in the highlighted state when tapped—that is, while your finger is pressed down. Visual feedback to taps and touches are critically important for touchscreen gadgets, and your buttons should signal that they've been pressed by changing their look, even subtly, in the highlighted state. The standard settings for a rounded rectangle button, for example, light up the normally white button with a blue background when tapped. For custom buttons, swapping out the background image or changing the icon image when pressed provides similar feedback.
Depending on how you're using your button, you might have two additional states to design for, too. The disabled state applies when a button is inactive and can't be used. The selected state applies when a button is "on," appropriate for a toggle button.