<!--
{
  "availability" : [
    "iOS: 8.0.0 - 15.0.0",
    "iPadOS: 8.0.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "macOS: 10.10.0 - 12.0.0",
    "swift: 4.2.0 -",
    "tvOS: 9.0.0 - 15.0.0",
    "visionOS: -",
    "watchOS: 6.0.0 - 8.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKFetchSubscriptionsOperation/fetchSubscriptionCompletionBlock-6hhpi",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So29CKFetchSubscriptionsOperationC8CloudKitE32fetchSubscriptionCompletionBlockySDySSSo14CKSubscriptionCGSg_s5Error_pSgtcSgvp"
  },
  "title" : "fetchSubscriptionCompletionBlock"
}
-->

# fetchSubscriptionCompletionBlock

The block to execute with the fetch results.

```
var fetchSubscriptionCompletionBlock: (([CKSubscription.ID : CKSubscription]?, (any Error)?) -> Void)? { get set }
```

## Discussion

The closure returns no value and takes the following parameters:

- A dictionary with keys that are the IDs of the subscriptions you request, and values that are the corresponding subscriptions.
- An error that contains information about a problem, or `nil` if the system successfully fetches the subscriptions.

The operation executes this closure only once, and it’s your only opportunity to process the results. 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 retrieves only some of the subscriptions successfully. The <doc://com.apple.documentation/documentation/Foundation/NSError/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 the IDs of the subscriptions that the operation can’t fetch, 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)