---
title: "delete(withRecordZoneID:completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckdatabase/delete(withrecordzoneid:completionhandler:)"
---

# delete(withRecordZoneID:completionHandler:)

Deletes a specific record zone.

## Declaration

```swift
func delete(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping @Sendable (CKRecordZone.ID?, (any Error)?) -> Void)
```

```swift
func delete(withRecordZoneID zoneID: CKRecordZone.ID) async throws -> CKRecordZone.ID
```

## Parameters

- `zoneID`: The identifier of the record zone to delete.
- `completionHandler`: The closure to execute after CloudKit deletes the record zone.

## 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. The completion handler takes the following parameters: The identifier of the deleted record zone, or nil if there’s an error. An error if a problem occurs, or nil if CloudKit successfully deletes the record zone. For information on a more convenient way to delete record zones, see modifyRecordZones(saving:deleting:).

## See Also

### Modifying Record Zones

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