Contents

fetch(withSubscriptionID:completionHandler:)

Fetches a specific subscription and delivers it to a completion handler.

Declaration

@preconcurrency func fetch(withSubscriptionID subscriptionID: CKSubscription.ID, completionHandler: @escaping  @Sendable (CKSubscription?, (any Error)?) -> Void)

Parameters

  • subscriptionID:

    The identifier of the subscription to fetch.

  • completionHandler:

    The closure to execute with the fetch results.

Discussion

The completion handler takes the following parameters:

  • The requested subscription, or nil if CloudKit can’t provide that subscription.

  • An error if a problem occurs, or nil if the fetch completes successfully.

For information on a more convenient way to fetch specific subscriptions, see subscriptions(for:).

See Also

Fetching Subscriptions