---
title: "modifyRecordZones(saving:deleting:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/modifyrecordzones(saving:deleting:)"
---

# modifyRecordZones(saving:deleting:)

Modifies the specified record zones and returns the results to an awaiting caller.

## Declaration

```swift
func modifyRecordZones(saving recordZonesToSave: [CKRecordZone], deleting recordZoneIDsToDelete: [CKRecordZone.ID]) async throws -> (saveResults: [CKRecordZone.ID : Result<CKRecordZone, any Error>], deleteResults: [CKRecordZone.ID : Result<Void, any Error>])
```

## Parameters

- `recordZonesToSave`: The record zones to save.
- `recordZoneIDsToDelete`: The identifiers of the record zones to permanently delete.

## Return Value

Return Value A tuple with the following named elements:

## Discussion

Discussion warning: Deleting a record zone is a permanent action that deletes every record in that zone. You can’t restore a deleted record zone. This method throws an error if the request fails, such as when the network is unavailable or the device doesn’t have an active iCloud account; otherwise, the returned tuple includes any individual record zone errors. For information on a more configurable way to modify record zones, see CKModifyRecordZonesOperation.

## See Also

### Modifying Record Zones

- [modifyRecordZones(saving:deleting:completionHandler:)](cloudkit/ckdatabase/modifyrecordzones(saving:deleting:completionhandler:).md)
- [save(_:completionHandler:)](cloudkit/ckdatabase/save(_:completionhandler:)-32ffr.md)
- [delete(withRecordZoneID:completionHandler:)](cloudkit/ckdatabase/delete(withrecordzoneid:completionhandler:).md)
