---
title: "prepare(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/prepare(_:)"
---

# prepare(_:)

Perform any custom setup associated with a sharing service picker.

## Declaration

```swift
func prepare(_ sharingServicePicker: NSSharingServicePicker)
```

## Parameters

- `sharingServicePicker`: The sharing service picker the system is about to display.

## Discussion

Discussion Override this method, as needed, and use it to configure the sharing service picker before AppKit displays it. The default implementation of this method does nothing. You might customize the contents of the share menu or provide a custom delegate for the chosen sharing service. You can get the default sharing menu item by calling standardShareMenuItem() on the current document controller.

## See Also

### Sharing the Document

- [allowsDocumentSharing](appkit/nsdocument/allowsdocumentsharing.md)
- [share(with:completionHandler:)](appkit/nsdocument/share(with:completionhandler:).md)
