Instance Method

presentOptionsMenuFromRect:inView:animated:

Displays an options menu and anchors it to the specified location in the view.

Declaration

- (BOOL)presentOptionsMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;

Parameters

rect

The location (in the coordinate system of view) at which to anchor the menu.

view

The view from which to display the options menu.

animated

Specify YES to animate the appearance of the menu or NO to display it immediately.

Return Value

YES if the options menu was displayed or NO if it was not. The options menu may not be displayed in cases where there are no appropriate items to include in the menu.

Discussion

The contents of the options menu are built dynamically based on three things:

  • The type of the document (as specified by the UTI property)

  • The set of installed apps that have registered support for opening documents

  • The actions that you have indicated as supported in the document interaction controller delegate’s documentInteractionController:canPerformAction: method

Options that cannot be performed on the current document are not included in the menu. For example, if the document cannot be opened by any known apps, the menu does not include options for opening it.

This method displays the options menu asynchronously. The menu is dismissed automatically when the user selects one of the available options. You can also dismiss it programmatically using the dismissMenuAnimated: method.

To instead present a menu that contains only a list of apps capable of opening the current document, the presentOpenInMenuFromRect:inView:animated: method instead.

See Also

Presenting and Dismissing Menus

- presentOptionsMenuFromBarButtonItem:animated:

Displays an options menu and anchors it to the specified bar button item.

- presentOpenInMenuFromRect:inView:animated:

Displays a menu for opening the document and anchors that menu to the specified view.

- presentOpenInMenuFromBarButtonItem:animated:

Displays a menu for opening the document and anchors that menu to the specified bar button item.

- dismissMenuAnimated:

Dismisses the currently active menu.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software