---
title: "sharingService(_:didCompleteForItems:error:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscloudsharingservicedelegate/sharingservice(_:didcompleteforitems:error:)"
---

# sharingService(_:didCompleteForItems:error:)

Tells the delegate when the cloud-sharing service completes.

## Declaration

```swift
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

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:) and sharingService(_:didShareItems:) methods.

## See Also

### Managing the Cloud-Sharing Service

- [sharingService(_:didSave:)](appkit/nscloudsharingservicedelegate/sharingservice(_:didsave:).md)
- [sharingService(_:didStopSharing:)](appkit/nscloudsharingservicedelegate/sharingservice(_:didstopsharing:).md)
- [options(for:share:)](appkit/nscloudsharingservicedelegate/options(for:share:).md)
- [NSSharingService.CloudKitOptions](appkit/nssharingservice/cloudkitoptions.md)
