---
title: NSPreviewRepresentableActivityItem
framework: appkit
role: symbol
role_heading: Protocol
path: appkit/nspreviewrepresentableactivityitem
---

# NSPreviewRepresentableActivityItem

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

## Declaration

```swift
protocol NSPreviewRepresentableActivityItem : NSObjectProtocol
```

## Overview

Overview Adopt the 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 object with the object that adopts this protocol. note: If your data consists of standard types like strings or images, use an 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](appkit/nspreviewrepresentableactivityitem/item.md)

### Providing Metadata About the Item

- [title](appkit/nspreviewrepresentableactivityitem/title.md)
- [imageProvider](appkit/nspreviewrepresentableactivityitem/imageprovider.md)
- [iconProvider](appkit/nspreviewrepresentableactivityitem/iconprovider.md)

## Relationships

### Inherits From

- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

### Conforming Types

- [NSPreviewRepresentingActivityItem](appkit/nspreviewrepresentingactivityitem.md)

## See Also

### App Services

- [NSSharingService](appkit/nssharingservice.md)
- [NSSharingServicePicker](appkit/nssharingservicepicker.md)
- [NSSharingServicePickerToolbarItem](appkit/nssharingservicepickertoolbaritem.md)
- [NSServicesMenuRequestor](appkit/nsservicesmenurequestor.md)
- [NSCloudSharingServiceDelegate](appkit/nscloudsharingservicedelegate.md)
- [Services Functions](appkit/services-functions.md)
