<!--
{
  "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/perShareCompletionBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKAcceptSharesOperation(py)perShareCompletionBlock"
  },
  "title" : "perShareCompletionBlock"
}
-->

# perShareCompletionBlock

The block to execute as CloudKit processes individual shares.

```
var perShareCompletionBlock: ((CKShare.Metadata, CKShare?, (any Error)?) -> Void)? { get set }
```

## Discussion

The closure returns no value and takes the following parameters:

- The share metadata to process.
- The share, or `nil` if CloudKit can’t process the share metadata.
- If CloudKit can’t process the share metadata, this parameter provides information about the failure; otherwise, it’s `nil`.

The operation executes this closure once for each element in the [`shareMetadatas`](/documentation/CloudKit/CKAcceptSharesOperation/shareMetadatas) property. Each time the closure executes, it executes serially with respect to the other closures of the operation.

If you intend to use this closure to process results, set it before you execute the operation or submit the operation 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)