<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCloudSharingServiceDelegate/sharingService(_:didCompleteForItems:error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSCloudSharingServiceDelegate(im)sharingService:didCompleteForItems:error:"
  },
  "title" : "sharingService(_:didCompleteForItems:error:)"
}
-->

# sharingService(_:didCompleteForItems:error:)

Tells the delegate when the cloud-sharing service completes.

```
optional func sharingService(_ sharingService: NSSharingService, didCompleteForItems items: [Any], error: (any Error)?)
```

## Parameters

`sharingService`

The cloud-sharing service that invokes this delegate method.

`items`

The items the service is sharing.

`error`

If the service can’t share the items, an error that provides information about the failure; otherwise, <doc://com.apple.documentation/documentation/ObjectiveC/nil-227m0>.

## Discussion

The cloud-sharing service invokes this method when the user finishes sharing or dismisses the service’s view controller. If you implement this method, the service calls it instead of the [`sharingService(_:didFailToShareItems:error:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:didFailToShareItems:error:)) and [`sharingService(_:didShareItems:)`](/documentation/AppKit/NSSharingServiceDelegate/sharingService(_:didShareItems:)) methods.

---

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)