<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPreviewRepresentableActivityItem",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPreviewRepresentableActivityItem"
  },
  "title" : "NSPreviewRepresentableActivityItem"
}
-->

# NSPreviewRepresentableActivityItem

An interface you adopt in custom objects that you want to share using the macOS share sheet.

```
protocol NSPreviewRepresentableActivityItem : NSObjectProtocol
```

## Overview

Adopt the [`NSPreviewRepresentableActivityItem`](/documentation/AppKit/NSPreviewRepresentableActivityItem) interface in custom types your app makes available for sharing. Use this protocol to specify the item itself and a title and image the share sheet can use to create a preview for your item. To share the item from your app, initialize the [`NSSharingServicePicker`](/documentation/AppKit/NSSharingServicePicker) object with the object that adopts this protocol.

> Note:
> If your data consists of standard types like strings or images, use an ``doc://com.apple.appkit/documentation/AppKit/NSPreviewRepresentingActivityItem`` object to specify metadata for those types. If your data consists of URLs, pass them directly to the sharing service picker instead of creating a custom preview item.

## Topics

### Providing the Item to Share

[`item`](/documentation/AppKit/NSPreviewRepresentableActivityItem/item)

The app-specific item you want to share.

### Providing Metadata About the Item

[`title`](/documentation/AppKit/NSPreviewRepresentableActivityItem/title)

A localized string that contains the name of the item.

[`imageProvider`](/documentation/AppKit/NSPreviewRepresentableActivityItem/imageProvider)

An object that provides a visual representation of the item.

[`iconProvider`](/documentation/AppKit/NSPreviewRepresentableActivityItem/iconProvider)

An object that provides an icon that represents the item’s source.



---

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)