Instance Method

documentInteractionController:canPerformAction:

Called when a document interaction controller needs to know whether the specified action can be performed on the associated document.

Declaration

- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(SEL)action;

Parameters

controller

The document interaction controller managing an associated document.

action

The selector representing the action in question.

Return Value

YES if the specified action is supported for the associated document or NO if it is not. If you do not implement this method, the return value is assumed to be NO.

Discussion

When building the options menu (invoked, for example, by the user performing a long press gesture), a document interaction controller calls this method to find out if your app can perform various actions. If you implement this method for a given action, you must also implement the documentInteractionController:performAction: method for that action.

The supported action selectors for this method are copy: and print:. (The print: selector is available in iOS 4.2 and later. Printing is supported only on devices that support multitasking.)

For each action that you implement in the documentInteractionController:performAction: delegate method, return YES from this method if that action is available for the document.

See Also

Managing Actions

- documentInteractionController:performAction:

Called when a document interaction controller wants its delegate to perform a specified action with the associated document.

Deprecated