Instance Method

canPerformWithActivityItems:

Returns a Boolean indicating whether the service can act on the specified data items.

Declaration

- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems;

Parameters

activityItems

An array of objects of varying types. These are the data objects on which the service would act.

Return Value

YES if your service can act on the specified data items or NO if it cannot.

Discussion

The default implementation of this method returns NO. Subclasses must override it and return YES if the data in the activityItems parameter can be operated on by your service. Your implementation should check the types of the objects in the array and use that information to determine if your service can act on the corresponding data.

The UIActivityViewController object calls this method when determining which services to show to the user.

See Also

Performing the Activity

- prepareWithActivityItems:

Prepares your service to act on the specified data.

activityViewController

Returns the view controller to present to the user.

- performActivity

Performs the service when no custom view controller is provided.

- activityDidFinish:

Notifies the system that your activity object has completed its work.

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