save(_:completionHandler:)
Saves a specific subscription.
Declaration
func save(_ subscription: CKSubscription, completionHandler: @escaping @Sendable (CKSubscription?, (any Error)?) -> Void)func save(_ subscription: CKSubscription) async throws -> CKSubscriptionParameters
- 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
nilif there’s an error.An error if a problem occurs, or
nilif CloudKit successfully saves the subscription.
For information on a more convenient way to save subscriptions, see modifySubscriptions(saving:deleting:).