<!--
{
  "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.

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

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

### Getting an Anchor View

[`-  anchoringViewForSharingService:showRelativeToRect: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.

## Relationships

### Inherited By

[`NSCloudSharingServiceDelegate`](/documentation/AppKit/NSCloudSharingServiceDelegate)

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)