UIMenuController

Next you are going to make it so that when the user selects a line, a menu with the option to delete that line appears where the user tapped. There is a built-in class for providing this sort of menu called UIMenuController (Figure 18.3). A menu controller has a list of UIMenuItem objects and is presented in an existing view. Each item has a title (what shows up in the menu) and an action (the message it sends the first responder of the window).

Figure 18.3  A UIMenuController

A UIMenuController

There is only one UIMenuController per application. When you wish to present this instance, you fill it with menu items, give it a ...

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