<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICloudSharingController/activityItemSource()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICloudSharingController(im)activityItemSource"
  },
  "title" : "activityItemSource()"
}
-->

# activityItemSource()

The activity item object that can be used by an activity view controller.

```
func activityItemSource() -> any UIActivityItemSource
```

## Discussion

Use [`activityItemSource()`](/documentation/UIKit/UICloudSharingController/activityItemSource()), an object that conforms to the [`UIActivityItemSource`](/documentation/UIKit/UIActivityItemSource) protocol, when you want to include the CloudKit Sharing action as one of the action items in an instance of [`UIActivityViewController`](/documentation/UIKit/UIActivityViewController).

Including [`activityItemSource()`](/documentation/UIKit/UICloudSharingController/activityItemSource()) in an activity view controller can be useful when your app’s user interface doesn’t have space to display a button dedicated to CloudKit Sharing. For instance, say your app already has an action button that lets the user share data with social media sites or other apps through an activity view controller. If you include [`activityItemSource()`](/documentation/UIKit/UICloudSharingController/activityItemSource()) as one of the activity view controller’s action items, the controller includes the action as a user-selectable option, thus eliminating the need for a second button in your app’s user interface.

```swift
let items = [cloudSharingController.activityItemSource()]
let activityController = UIActivityViewController(activityItems: items, applicationActivities: [])
present(activityController, animated: true, completion: {})
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)