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

# NSCloudSharingServiceDelegate

A set of methods for responding to the life cycle events of the cloud-sharing service.

```
protocol NSCloudSharingServiceDelegate : NSSharingServiceDelegate
```

## Overview

CloudKit allows a user to share a hierarchy of records with other iCloud users. In macOS, you use <doc://com.apple.documentation/documentation/Foundation/NSItemProvider> and [`NSSharingService`](/documentation/AppKit/NSSharingService) to facilitate sharing. Register an instance of <doc://com.apple.documentation/documentation/CloudKit/CKShare> with an item provider, and then use a sharing service to present it to the user. You must initialize the service with the [`cloudSharing`](/documentation/AppKit/NSSharingService/Name/cloudSharing) service name. If the share is new, the user can configure the share and invite other iCloud users to participate. Otherwise, they can use the service to manage the share’s participants and their permissions.

This protocol defines methods that the sharing service calls when it saves changes to a share, or deletes it. The service also asks its delegate to provide the preferred sharing options when creating a new share. Set the service’s [`delegate`](/documentation/AppKit/NSSharingService/delegate) property to an object that implements this protocol. Use your implementation to provide any appropriate behavior, such as deleting a share you cache locally when the service deletes it from the server.

For more information about CloudKit sharing, see <doc://com.apple.documentation/documentation/CloudKit/shared-records>.

## Topics

### Managing the Cloud-Sharing Service

[`sharingService(_:didCompleteForItems:error:)`](/documentation/AppKit/NSCloudSharingServiceDelegate/sharingService(_:didCompleteForItems:error:))

Tells the delegate when the cloud-sharing service completes.

[`sharingService(_:didSave:)`](/documentation/AppKit/NSCloudSharingServiceDelegate/sharingService(_:didSave:))

Tells the delegate when the cloud-sharing service saves the CloudKit share.

[`sharingService(_:didStopSharing:)`](/documentation/AppKit/NSCloudSharingServiceDelegate/sharingService(_:didStopSharing:))

Tells the delegate when the user stops sharing the CloudKit share.

[`options(for:share:)`](/documentation/AppKit/NSCloudSharingServiceDelegate/options(for:share:))

Asks the delegate for the participant options for the cloud-sharing service.

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

Constants that describe how a participant can configure a CloudKit share.



---

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)