---
title: UIActivityItemProvider
framework: uikit
role: symbol
role_heading: Class
path: uikit/uiactivityitemprovider
---

# UIActivityItemProvider

A proxy for data that passes to an activity view controller.

## Declaration

```swift
class UIActivityItemProvider
```

## Overview

Overview You can use a provider object in situations where you want to make data available for use by an activity but you want to delay providing that data until it’s actually needed. For example, you might use a provider object to represent a large video file that needs to be processed before it can be shared to a user’s social media account. When you initialize a UIActivityViewController object, you can pass a provider object in addition to any other data objects. When the user selects an activity, the activity view controller adds your provider object (which is also an operation object) to an operation queue so that it can begin to gather or process the needed data. Subclassing notes You must subclass UIActivityItemProvider and implement its item method, which is called to generate the item data. You implement this method instead of the normal main() method you’d implement for an operation object. (The main() method calls the item method when the operation object is executed.) Your implementation of the item method should do whatever work is necessary to create and return the data.

## Topics

### Initializing the provider

- [init(placeholderItem:)](uikit/uiactivityitemprovider/init(placeholderitem:).md)

### Accessing the provider attributes

- [item](uikit/uiactivityitemprovider/item.md)
- [placeholderItem](uikit/uiactivityitemprovider/placeholderitem.md)
- [activityType](uikit/uiactivityitemprovider/activitytype.md)

## Relationships

### Inherits From

- [Operation](foundation/operation.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [UIActivityItemSource](uikit/uiactivityitemsource.md)

## See Also

### Services

- [UIActivity](uikit/uiactivity.md)
- [UIActivityViewController](uikit/uiactivityviewcontroller.md)
- [UIActivityItemSource](uikit/uiactivityitemsource.md)
