<!--
{
  "availability" : [
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/prepare(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)prepareSharingServicePicker:"
  },
  "title" : "prepare(_:)"
}
-->

# prepare(_:)

Perform any custom setup associated with a sharing service picker.

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

## Parameters

`sharingServicePicker`

The sharing service picker the system is about to display.

## 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()`](/documentation/AppKit/NSDocumentController/standardShareMenuItem()) on the current document controller.

---

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)