allTokens
TypeScriptallTokens(): Array<string>Swift declarationfunc allTokens() -> [String]class · iOS 8.0+ · SDK 27.1
class CKRecordallTokens(): Array<string>Swift declarationfunc allTokens() -> [String]encodeSystemFields(coder: _Foundation_NSCoder): voidSwift declarationfunc encodeSystemFields(with coder: NSCoder)subscript(key: string): (SDKHandle) | nullSwift declarationsubscript(key: String) -> (any __CKRecordObjCValue)? { get set }setParent(parentRecord?: (CKRecord) | null): voidSwift declarationfunc setParent(_ parentRecord: CKRecord?)setParent16582(parentRecordID?: (CKRecord_ID) | null): voidSwift declarationfunc setParent(_ parentRecordID: CKRecord.ID?)get creationDate(): (globalThis.Date) | nullSwift declarationvar creationDate: Date? { get }get creatorUserRecordID(): (CKRecord_ID) | nullSwift declaration@NSCopying var creatorUserRecordID: CKRecord.ID? { get }get encryptedValues(): (SDKHandle) & (SDKHandle)Swift declaration@NSCopying var encryptedValues: any CKRecordKeyValueSetting & Sendable { get }get lastModifiedUserRecordID(): (CKRecord_ID) | nullSwift declaration@NSCopying var lastModifiedUserRecordID: CKRecord.ID? { get }get modificationDate(): (globalThis.Date) | nullSwift declarationvar modificationDate: Date? { get }get parent(): (CKRecord_Reference) | nullSwift declaration@NSCopying var parent: CKRecord.Reference? { get set }set parent(value: (CKRecord_Reference) | null)Swift declaration@NSCopying var parent: CKRecord.Reference? { get set }get recordChangeTag(): (string) | nullSwift declarationvar recordChangeTag: String? { get }get recordID(): CKRecord_IDSwift declaration@NSCopying var recordID: CKRecord.ID { get }get share(): (CKRecord_Reference) | nullSwift declaration@NSCopying var share: CKRecord.Reference? { get }static initRecordTypeRecordID(recordType: string, recordID?: CKRecord_ID): CKRecordSwift declarationconvenience init(recordType: CKRecord.RecordType, recordID: CKRecord.ID = CKRecord.ID())Creates a record using an ID that you provide. - 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. - recordID: The ID to assign to the record. When creating the ID, you can specify the zone where you want to store the record. You should provide a value that is unique across all records and may not provide `nil`. 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 ``CKDatabase/save(_:completionHandler:)-3tatz`` method to transfer the record's contents to the server.
static initRecordTypeZoneID(recordType: string, zoneID: CKRecordZone_ID): CKRecordSwift declarationconvenience init(recordType: CKRecord.RecordType, zoneID: CKRecordZone.ID)Creates a record in the specified zone. @DeprecationSummary { Use ``CKRecord/init(recordType:recordID:)`` instead. } - 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. 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 ``CKDatabase/save(_:completionHandler:)-3tatz`` method to transfer the record's contents to the server.
get recordType(): stringSwift declarationvar recordType: CKRecord.RecordType { get }The value that your app defines to identify the type of record. Use this value to differentiate between different record types in your app. The value is primarily for your benefit, so choose record types that represent the data in the corresponding records. CloudKit provides two system-defined record types: | Record Type | Description | |---|---| | ``CKRecordTypeUserRecord-49k30`` | Identifies records that represent users. | | ``CKRecordTypeShare-8b6yt`` | Identifies records that the user shares. |
changedKeys(): Array<string>Swift declarationfunc changedKeys() -> [CKRecord.FieldKey]Returns an array of keys with recent changes to their values. - Returns: An array of keys with changed values since downloading or saving the record. If there aren't any changed keys, this method returns an empty array.
makeIterator(): CKRecordKeyValueIteratorSwift declarationfunc makeIterator() -> CKRecordKeyValueIteratorReturns an iterator of the record's key-value pairs.
object(key: string): (SDKHandle) | nullSwift declarationfunc object(forKey key: CKRecord.FieldKey) -> (any __CKRecordObjCValue)?Returns the object that the record stores for the specified key. - Parameters: - key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces. - Returns: The object for the specified key, or `nil` if no such key exists in the record. New records don't contain any keys or values. Values are always one of the data types in <doc:CKRecord#Supported-Data-Types>. You access the fields of a `CKRecord` object the same way you access key-value pairs in a dictionary. The `CKRecord` class defines the ``CKRecord/object(forKey:)`` and ``CKRecord/setObject(_:forKey:)`` methods for getting and setting values. It also supports dictionary index notation. The following example shows how to use both techniques to set a `firstName` field and retrieve a `lastName` field from a record: ```swift // Equivalent ways to get a value. var hiredAt = record.object(forKey: "hiredAt") hiredAt = record["hiredAt"] ```
allKeys(): Array<string>Swift declarationfunc allKeys() -> [CKRecord.FieldKey]Returns an array of the record's keys. - Returns: An array of keys, or an empty array if the record doesn't contain any keys. The array contains only those keys with values that aren't `nil`.
setObject(object: (SDKHandle) | null, key: string): voidSwift declarationfunc setObject(_ object: (any __CKRecordObjCValue)?, forKey key: CKRecord.FieldKey)Stores an object in the record using the specified key. - Parameters: - object: The object to store using the specified key. The value you provide must be an instance of one the data types in <doc:CKRecord#Supported-Data-Types>. You receive an error if you use a data type that CloudKit doesn't support. If you specify `nil`, CloudKit removes any object that the record associates with the key. - key: The key to associate with `object`. Use this key to retrieve the value later. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces. Avoid using a key that matches the name of any property of `CKRecord`. If the specified key already exists in the record, CloudKit deletes its previous value and replaces it with the one in the `object` parameter. This change affects only the local copy of the record. You must save the record to the server again before the change becomes available to other clients. If the type of the `object` parameter differs from the type of the object that's on the server, you encounter an error when you attempt to save this record to the server. For example, if the current value is an <doc://com.apple.documentation/documentation/foundation/nsstring> object, you receive an error if you change the value to an <doc://com.apple.documentation/documentation/foundation/nsnumber> object and save the record. You access the fields of a `CKRecord` object the same way you access key-value pairs in a dictionary. The `CKRecord` class defines the ``CKRecord/object(forKey:)`` and ``CKRecord/setObject(_:forKey:)`` methods for getting and setting values. It also supports dictionary index notation. The following example shows how to use both techniques to set a `firstName` field and get a `lastName` field from a record: ```swift // Equivalent ways to set a value. let record = CKRecord(recordType: "Employee") record.setObject(NSDate(), forKey: "hiredAt") record["hiredAt"] = NSDate() ```
subscript3079(key: string): (SDKHandle) | nullSwift declarationsubscript(key: CKRecord.FieldKey) -> (any __CKRecordObjCValue)? { get set }Returns the object that the record stores for the specified key. - Parameters: - key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces. - Returns: The object for the specified key, or `nil` if no such key exists in the record.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
CKRecord.init()
inherited init: cannot prove legal (class declares 2 custom initializers)