<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "swift: 4.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKRecord/ID/init(recordName:zoneID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So10CKRecordIDC8CloudKitE10recordName04zoneB0ABSS_So0a4ZoneB0Ctcfc"
  },
  "title" : "init(recordName:zoneID:)"
}
-->

# init(recordName:zoneID:)

Creates a new record ID with the specified name and zone information.

```
convenience init(recordName: String = UUID().uuidString, zoneID: CKRecordZone.ID = CKRecordZone.ID.default)
```

## Parameters

`recordName`

The name that identifies the record. The string must contain only ASCII characters, must not exceed 255 characters, and must not start with an underscore. If you specify an empty string for this parameter, the method throws an exception.

`zoneID`

The ID of the record zone where you want to store the record. This parameter must not be `nil`.

## Discussion

Use this method when you create or search for records in a zone other than the default zone. The value in the `zoneID` parameter must represent a zone that already exists in the database. If the record zone doesn’t exist, save the corresponding [`CKRecordZone`](/documentation/CloudKit/CKRecordZone) object to the database before attempting to save any [`CKRecord`](/documentation/CloudKit/CKRecord) objects in that zone.

---

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)