Contents

save(_:completionHandler:)

Saves a specific subscription.

Declaration

func save(_ subscription: CKSubscription, completionHandler: @escaping  @Sendable (CKSubscription?, (any Error)?) -> Void)
func save(_ subscription: CKSubscription) async throws -> CKSubscription

Parameters

  • subscription:

    The subscription to save.

  • completionHandler:

    The closure to execute after CloudKit saves the subscription.

Discussion

The completion handler takes the following parameters:

  • The saved subscription (as it appears on the server), or nil if there’s an error.

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

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

See Also

Modifying Subscriptions