---
title: "activityViewController(_:itemForActivityType:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiactivityitemsource/activityviewcontroller(_:itemforactivitytype:)"
---

# activityViewController(_:itemForActivityType:)

Returns the data object to be acted upon.

## Declaration

```swift
func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any?
```

## Parameters

- `activityViewController`: The activity view controller object requesting the data item.
- `activityType`: The type of activity to be performed with the data object. You can use this string to decide how best to prepare the data object.

## Return Value

Return Value The final data object to be acted on. May be nil if multiple items were registered for a single activity type, so long as one of the items returns an actual value.

## Discussion

Discussion This method returns the actual data object to be acted on by an activity object. Your implementation of this method should create or generate the data object and return it as quickly as possible.

## See Also

### Getting the data items

- [activityViewControllerPlaceholderItem(_:)](uikit/uiactivityitemsource/activityviewcontrollerplaceholderitem(_:).md)
