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

# init(recordType:zoneID:)

Creates a record in the specified zone.

```
convenience init(recordType: CKRecord.RecordType, zoneID: CKRecordZone.ID)
```

## Parameters

`recordType`

A string that represents the type of record that you want to create. You can’t change the record type after initialization. You define the record types that your app supports and use them to distinguish between records with different types of data. This parameter must not be `nil` or contain an empty string.

    A record type must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces.

`zoneID`

The ID of the record zone where you want to store the record.

## Discussion

Use this method to initialize a new record object with the specified ID. The newly created record contains no data.

Upon creation, record objects exist only in memory on the local device. Save the record using a [`CKModifyRecordsOperation`](/documentation/CloudKit/CKModifyRecordsOperation) object or by using the [`save(_:completionHandler:)`](/documentation/CloudKit/CKDatabase/save(_:completionHandler:)-3tatz) method to transfer the record’s contents to the server.

---

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)