<!--
{
  "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/init(zoneName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKRecordZone(im)initWithZoneName:"
  },
  "title" : "init(zoneName:)"
}
-->

# init(zoneName:)

Creates a record zone object with the specified zone name.

```
init(zoneName: String)
```

## Parameters

`zoneName`

The name of the new zone. Zone names inside a user’s private database are unique, consist of up to 255 ASCII characters, and don’t start with an underscore. One way to satisfy the uniqueness of zone names is to create a string from a Universally Unique Identifier (UUID), but you can also use other techniques.

    If this parameter is     `nil`     or is an empty string, the method throws an exception.

## Return Value

The new custom zone.

## Discussion

Use this method to create a new record zone. The new zone has the name you provide and the zone’s owner is the current user. After creating the zone, save it to the server using a [`CKModifyRecordZonesOperation`](/documentation/CloudKit/CKModifyRecordZonesOperation) object or the [`save(_:completionHandler:)`](/documentation/CloudKit/CKDatabase/save(_:completionHandler:)-32ffr) method of [`CKDatabase`](/documentation/CloudKit/CKDatabase). You must save the zone to the server before you attempt to save any records to that zone.

Don’t use this method to create a `CKRecordZone` object that corresponds to a zone that already exists in the database. If the zone exists, fetch it using a [`CKFetchRecordZonesOperation`](/documentation/CloudKit/CKFetchRecordZonesOperation) object or the [`fetch(withRecordZoneID:completionHandler:)`](/documentation/CloudKit/CKDatabase/fetch(withRecordZoneID:completionHandler:)) method of [`CKDatabase`](/documentation/CloudKit/CKDatabase).

---

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)