---
title: "modifySubscriptions(saving:deleting:completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/modifysubscriptions(saving:deleting:completionhandler:)"
---

# modifySubscriptions(saving:deleting:completionHandler:)

Modifies the specified subscriptions and delivers the results to a completion handler.

## Declaration

```swift
@preconcurrency func modifySubscriptions(saving subscriptionsToSave: [CKSubscription], deleting subscriptionIDsToDelete: [CKSubscription.ID], completionHandler: @escaping @Sendable (Result<(saveResults: [CKSubscription.ID : Result<CKSubscription, any Error>], deleteResults: [CKSubscription.ID : Result<Void, any Error>]), any Error>) -> Void)
```

## Parameters

- `subscriptionsToSave`: The subscriptions to save.
- `subscriptionIDsToDelete`: The identifiers of the subscriptions to permanently delete.
- `completionHandler`: The closure to execute after CloudKit processes the changes.

## Discussion

Discussion The completion handler takes a single Result parameter that contains either a tuple, or an error if the request fails. For example, when the network is unavailable or the device doesn’t have an active iCloud account. When present, the tuple contains the following named elements: For information on a more configurable way to modify subscriptions, see CKModifySubscriptionsOperation.

## See Also

### Modifying Subscriptions

- [modifySubscriptions(saving:deleting:)](cloudkit/ckdatabase/modifysubscriptions(saving:deleting:).md)
- [save(_:completionHandler:)](cloudkit/ckdatabase/save(_:completionhandler:)-9pona.md)
- [deleteSubscription(withID:)](cloudkit/ckdatabase/deletesubscription(withid:).md)
- [delete(withSubscriptionID:completionHandler:)](cloudkit/ckdatabase/delete(withsubscriptionid:completionhandler:).md)
