Dismissing the Keyboard

Run the application, add and select an item, and touch the text field with the item’s name. When you touch the text field, a keyboard appears onscreen (Figure 14.7), as you saw in your WorldTrotter app in Chapter 4. (If you are using the simulator and the keyboard does not appear, remember that you can press Command-K to toggle the device keyboard.)

Figure 14.7  Keyboard appears when a text field is touched

A view controller shows three fields: Name, Serial, and Value. The pointer is placed over the text box across the name label. A “qwerty” keypad appears at the bottom.

The appearance of the keyboard in response to a touch is built in to the UITextField class as well as UITextView, so you do not have to do anything extra for the keyboard to appear. However, at ...

Get iOS Programming: The Big Nerd Ranch Guide, 6th Edition 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.