UIMenuController

Next you are going to make it so that when the user selects a line, a menu appears right where the user tapped that offers the option to delete that line. There is a built-in class for providing this sort of menu called UIMenuController (Figure 13.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 13.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, ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.