So why bother with text views at all when you can have the fancy web view option? Easy: You can make text views editable, but not web views (at least not without spinning lots of your own custom code). When you want to allow people to edit multiple lines of text, give them a text view with its edit switch turned on. Tap an editable text view, and a keyboard automatically slides up from screen bottom to take your input. In practice, this is most useful for brief notes, like the Notes field of the Contacts app, where formatting is rarely needed but editing most definitely is.
Figure 5-22. Wikipanion, a Wikipedia browser, includes the Bookmarks button at the right side of its search bar (top), and tapping that button displays a list of bookmarked Wikipedia articles to choose from. Once you start typing, the Bookmarks button is replaced by the Cancel button (bottom), which you can tap to clear the text.
Text view's scrappy little brother is the text field, a rectangular field which accepts only a single line of text. Like its multi-line sibling, a text field summons a keyboard when you tap it to edit, but it also sports a few decorative features that text views do not. The standard text field lets developers add an image, button, or text inside the field at the far left or right. The basic rule is to use the left side for identifying text or icons (insert the word "Search," or a magnifying glass icon for a search field) and the right side for buttons to trigger an action. The button that most makes the most common appearance in this right-side slot is the X-shaped Cancel button, which comes as a built-in option for text fields. The Cancel button clears the field's text, then disappears while the field remains empty and reappears when you type some text. Text fields inside search bars (page 149) get special treatment with one other optional built-in button: the Bookmarks button. Add this button to a search bar to signal the availability of saved search terms, like street addresses in the Maps app.
Text fields offer a few features that can help folks better understand the purpose of each field and enter appropriate values. A field's placeholder text appears in faint gray inside the field before someone enters their own text. As soon as you start typing, the placeholder disappears to make way for the "real" text. The placeholder can act as a label for the field ("Search Wikipedia") or it can hint at the type of entry or data format to type ("1234 Main St."). In either case, it's an effortless and subtle way to clue in your audience about how the field should be used, and a method you should embrace in all text fields.