<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKDatabase/delete(withRecordZoneID:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKDatabase(im)deleteRecordZoneWithID:completionHandler:"
  },
  "title" : "delete(withRecordZoneID:completionHandler:)"
}
-->

# delete(withRecordZoneID:completionHandler:)

Deletes a specific record zone.

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

## Parameters

`zoneID`

The identifier of the record zone to delete.

`completionHandler`

The closure to execute after CloudKit deletes the record zone.

## 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:)`](/documentation/CloudKit/CKDatabase/modifyRecordZones(saving:deleting:)).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)