Recipe: Dismissing Text Views with Custom Accessory Views

Custom accessory views allow you to present material whenever the keyboard is shown onscreen. Common uses include adding custom buttons and other controls such as font and color pickers that affect text as the user types or additional navigation through forms. Recipe 6-2 adds two buttons: one that clears already-typed text and another that dismisses the keyboard. Figure 6-3 shows the keyboard with these add-ons.

Image

Figure 6-3 Accessory input views allow you to add custom view elements to standard iOS keyboard presentations. Here, a pair of buttons augment iPhone and iPad keyboards.

Each ...

Get The Core iOS Developer’s Cookbook, Fifth 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.