<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKRecordZone",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKRecordZone"
  },
  "title" : "CKRecordZone"
}
-->

# CKRecordZone

A database partition that contains related records.

```
class CKRecordZone
```

## Overview

Zones are an important part of how you organize your data. The public and private databases each have a single default zone. In the private database, you can use [`CKRecordZone`](/documentation/CloudKit/CKRecordZone) objects to create additional custom zones as necessary. Use custom zones to arrange and encapsulate groups of related records in the private database. Custom zones support other capabilities too, such as the ability to write multiple records as a single atomic transaction.

Treat each custom zone as a single unit of data that is separate from every other zone in the database. You can add records inside the zone. You can also create links between the records inside a zone by using the [`CKRecord.Reference`](/documentation/CloudKit/CKRecord/Reference) class. However, the [`CKRecord.Reference`](/documentation/CloudKit/CKRecord/Reference) class doesn’t support cross-zone linking, so each reference object must point to a record in the same zone as the current record.

Use the [`CKRecordZone`](/documentation/CloudKit/CKRecordZone) class as-is and don’t subclass it.

### Creating a Custom Record Zone

Generally, you use instances of this class to create and manage custom zones. Although you can use this class to retrieve a database’s default zone, most operations act on records in the default zone by default, so you rarely need to specify it explicitly.

To create a custom zone, use [`CKRecordZone`](/documentation/CloudKit/CKRecordZone) to create the zone object, and then save that zone to the user’s private database using a [`CKModifyRecordZonesOperation`](/documentation/CloudKit/CKModifyRecordZonesOperation) object. You can’t save any records in the zone until you save it to the database. When creating records, explicitly specify the zone ID if you want the records to reside in a specific zone; otherwise, they save to the default zone. You can’t create custom zones in a public database.

After creating a `CKRecordZone` object and saving it to the database, you don’t interact with the object much. Instead, most interactions occur with its corresponding [`CKRecordZone.ID`](/documentation/CloudKit/CKRecordZone/ID) object, which you use to refer to the zone when creating records.

## Topics

### Creating a Record Zone

[`init(zoneName:)`](/documentation/CloudKit/CKRecordZone/init(zoneName:))

Creates a record zone object with the specified zone name.

[`init(zoneID:)`](/documentation/CloudKit/CKRecordZone/init(zoneID:))

Creates a record zone object with the specified zone ID.

[`CKRecordZone.ID`](/documentation/CloudKit/CKRecordZone/ID)

An object that uniquely identifies a record zone in a database.

### Getting the Default Record Zone

[`CKRecordZoneDefaultName`](/documentation/CloudKit/CKRecordZoneDefaultName-8mfij)

The default record zone’s name.

[`default()`](/documentation/CloudKit/CKRecordZone/default())

Returns the default record zone.

### Getting the Zone Attributes

[`zoneID`](/documentation/CloudKit/CKRecordZone/zoneID)

The unique ID of the zone.

[`capabilities`](/documentation/CloudKit/CKRecordZone/capabilities-swift.property)

The capabilities that the zone supports.

[`CKRecordZone.Capabilities`](/documentation/CloudKit/CKRecordZone/Capabilities-swift.struct)

The capabilities that a record zone supports.

### Sharing Records

[`share`](/documentation/CloudKit/CKRecordZone/share)

A reference to the record zone’s share record.



---

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)