Tom W
Tom W

Reputation: 578

iOS Option Popup - Similar to Cut/Copy/Paste

For an app I'm developing I need some popup options, similar to how Cut/Copy/Paste is displayed when selecting text in a UITextView or UIWebView.

However, I'm having trouble finding what this kind of popup is called. Is there a public API for them, or is it something that has to be implemented from scratch?

Upvotes: 4

Views: 3774

Answers (2)

Sylter
Sylter

Reputation: 1623

UIMenuController and UIMenuItem is what you are looking for.

Here you find also an example project by Apple that explains how to use them.

Upvotes: 7

nzeltzer
nzeltzer

Reputation: 521

The class you want to look at is UIMenuController.

If memory serves, you will need to create an array of UIMenuItem instances to describe the custom actions, and add them to the UIMenuController singleton using 'setMenuItems:'.

Upvotes: 11

Related Questions