<!--
{
  "availability" : [
    "iOS: 10.0.0 - 15.0.0",
    "iPadOS: 10.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "macOS: 10.12.0 - 12.0.0",
    "tvOS: 10.0.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 8.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKAcceptSharesOperation/acceptSharesCompletionBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKAcceptSharesOperation(py)acceptSharesCompletionBlock"
  },
  "title" : "acceptSharesCompletionBlock"
}
-->

# acceptSharesCompletionBlock

The closure to execute when the operation finishes.

```
var acceptSharesCompletionBlock: (((any Error)?) -> Void)? { get set }
```

## Discussion

The closure returns no value and takes the following parameter:

- An error that contains information about a problem, or `nil` if CloudKit successfully processes the shares.

The operation executes this closure only once. The closure executes on a background queue, so any tasks that require access to the main queue must dispatch accordingly.

The closure reports an error of type [`CKError.Code.partialFailure`](/documentation/CloudKit/CKError/Code/partialFailure) when it can’t process some of the shares. The `userInfo` dictionary of the error contains a [`CKPartialErrorsByItemIDKey`](/documentation/CloudKit/CKPartialErrorsByItemIDKey) key that has a dictionary as its value. The keys of the dictionary are share URLs that CloudKit can’t process, and the corresponding values are errors that contain information about the failures.

Set this property’s value before you execute the operation or submit it to a queue.

---

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)