---
title: NSPreviewRepresentingActivityItem
framework: appkit
role: symbol
role_heading: Class
path: appkit/nspreviewrepresentingactivityitem
---

# NSPreviewRepresentingActivityItem

A type that adds metadata to an item you share using the macOS share sheet.

## Declaration

```swift
class NSPreviewRepresentingActivityItem
```

## Overview

Overview An NSPreviewRepresentingActivityItem object provides a concrete implementation of the NSPreviewRepresentableActivityItem protocol. Use it to create shareable items for common types such as strings or images, or when you don’t want to adopt the NSPreviewRepresentableActivityItem protocol directly in your app’s objects. To share the item from your app, initialize the NSSharingServicePicker object with this object. note: If your data consists of a URL, pass that URL directly to the sharing service picker instead of using this class.

## Topics

### Creating a Preview Activity Item

- [init(item:title:image:icon:)](appkit/nspreviewrepresentingactivityitem/init(item:title:image:icon:).md)
- [init(item:title:imageProvider:iconProvider:)](appkit/nspreviewrepresentingactivityitem/init(item:title:imageprovider:iconprovider:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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)
- [NSPreviewRepresentableActivityItem](appkit/nspreviewrepresentableactivityitem.md)

## See Also

### Share Panel

- [NSSharingServicePicker](appkit/nssharingservicepicker.md)
- [NSPreviewRepresentableActivityItem](appkit/nspreviewrepresentableactivityitem.md)
