<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSharingServiceDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSSharingServiceDelegate"
  },
  "title" : "NSSharingServiceDelegate"
}
-->

# NSSharingServiceDelegate

A set of methods that you use to customize the position and animation of a share sheet, and to be notified whether the item is successfully shared.

```
protocol NSSharingServiceDelegate : NSObjectProtocol
```

## Overview

See [`NSSharingService`](/documentation/AppKit/NSSharingService) for more information.

## Topics

### Sharing Items

[`sharingService(_:willShareItems:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:willShareItems:))

Invoked when the sharing service will share the specified items.

[`sharingService(_:didShareItems:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:didShareItems:))

Invoked when the sharing service has finished sharing the items.

[`sharingService(_:didFailToShareItems:error:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:didFailToShareItems:error:))

Invoked when the sharing service encountered an error when sharing items.

### Customizing Transition Animation

[`sharingService(_:sourceFrameOnScreenForShareItem:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:sourceFrameOnScreenForShareItem:))

Invoked when the sharing service is performed and the sharing window is displayed, to present a transition between the original items and the sharing window.

[`sharingService(_:transitionImageForShareItem:contentRect:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:transitionImageForShareItem:contentRect:))

Invoked to allow returning a custom transition image when sharing an item.

[`sharingService(_:sourceWindowForShareItems:sharingContentScope:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:sourceWindowForShareItems:sharingContentScope:))

Returns the window that contained the share items.

[`NSSharingService.SharingContentScope`](/documentation/AppKit/NSSharingService/SharingContentScope)

The sharing scope constants specify the nature of the things you are sharing.

### Getting an Anchor View

[`anchoringView(for:showRelativeTo:preferredEdge:)`](/documentation/AppKit/NSSharingServiceDelegate/anchoringView(for:showRelativeTo:preferredEdge:))

The method invoked when the service is performed and wants to display its contents in a popover.



---

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)