---
title: "init(items:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nssharingservicepicker/init(items:)"
---

# init(items:)

Creates a new sharing service picker for the selected items.

## Declaration

```swift
init(items: [Any])
```

## Parameters

- `items`: The items to be shared. The items in the array must conform to the doc://com.apple.appkit/documentation/AppKit/NSPasteboardWriting or doc://com.apple.appkit/documentation/AppKit/NSPreviewRepresentableActivityItem protocol. For example, you can specify an doc://com.apple.documentation/documentation/Foundation/NSString, doc://com.apple.appkit/documentation/AppKit/NSImage, doc://com.apple.documentation/documentation/Foundation/NSURL, or similar type directly. You can also specify doc://com.apple.documentation/documentation/Foundation/NSItemProvider or doc://com.apple.appkit/documentation/AppKit/NSDocument objects in the array to share those types.

## Return Value

Return Value A configured sharing service picker.

## Discussion

Discussion If an item is an NSURL object and contains a file URL (pointing to a video on the local disk for example), the picker shares the content of the file. If the URL is remote, then the picker shares the URL instead of the contents.
