Contents

delete(withSubscriptionID:completionHandler:)

Deletes a specific subscription and delivers the deleted subscription’s identifier to a completion handler.

Declaration

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

Parameters

  • subscriptionID:

    The identifier of the subscription to delete.

  • completionHandler:

    The closure to execute after CloudKit deletes the subscription.

Discussion

The completion handler takes the following parameters:

  • The identifier of the deleted subscription, or nil if there’s an error.

  • An error if a problem occurs, or nil if CloudKit successfully deletes the subscription.

For information on a more convenient way to delete subscriptions, see modifySubscriptions(saving:deleting:).

See Also

Modifying Subscriptions