modifyRecordZones(saving:deleting:)
Modifies the specified record zones and returns the results to an awaiting caller.
Declaration
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
A tuple with the following named elements:
saveResultsA dictionary of saved record zones. The dictionary uses the identifiers of the record zones you specify in
recordZonesToSaveas its keys. The value of each key is a Result that contains either the corresponding modified record zone (as it appears on the server), or an error that describes why CloudKit can’t modify that record zone.deleteResultsA dictionary of deleted record zones. The dictionary uses the identifiers you specify in
recordZoneIDsToDeleteas its keys. The value of each key is a Result that contains either Void to indicate a successful deletion, or an error that describes why CloudKit can’t delete that record zone.
Discussion
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.