init(recordType:zoneID:)
Creates a record in the specified zone.
Declaration
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
nilor 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 object or by using the save(_:completionHandler:) method to transfer the record’s contents to the server.