A set of methods used by an activity view controller to retrieve the data items to act on.


@protocol UIActivityItemSource


You can use this protocol in situations where you want to provide the data from one of your app’s existing objects instead of creating a separate UIActivityItemProvider object. When implementing this protocol, your object becomes the data provider, providing the view controller with access to the items.

Because the methods of this protocol are executed on your app’s main thread, you should avoid using this protocol in cases where the data objects might take a significant amount of time to create. When creating large data objects, consider using a UIActivityItemProvider object instead.


Getting the Data Items

- activityViewControllerPlaceholderItem:

Returns the placeholder object for the data.


- activityViewController:itemForActivityType:

Returns the data object to be acted upon.


Providing Information About the Data Items

- activityViewController:subjectForActivityType:

For activities that support a subject field, returns the subject for the item.

- activityViewController:dataTypeIdentifierForActivityType:

For items that are provided as NSData, returns the UTI for the item.

- activityViewController:thumbnailImageForActivityType:suggestedSize:

For activities that support a preview image, returns a thumbnail preview image for the item.

Providing Metadata for Accelerated Previews

- activityViewControllerLinkMetadata:

Returns metadata to display in the preview header of the share sheet.


Inherits From

Conforming Types

See Also

Activities Interface


A view controller that you use to offer standard services from your app.


A proxy for data passed to an activity view controller.


An abstract class that you subclass to implement app-specific services.