One Logo Pool Ball
CloudKit · IOS API REFERENCE

CKQueryOperation

class · iOS 8.0+ · SDK 27.1

class CKQueryOperation

Members (22)

get · iOS 8.0+

maximumResults

TypeScript
static get maximumResults(): number
Swift declaration
class let maximumResults: Int
init · iOS 8.0+

init

TypeScript
static init(): CKQueryOperation
Swift declaration
init()
init · iOS 8.0+

init

TypeScript
static initCursor(cursor: CKQueryOperation_Cursor): CKQueryOperation
Swift declaration
convenience init(cursor: CKQueryOperation.Cursor)
init · iOS 8.0+

init

TypeScript
static initQuery(query: CKQuery): CKQueryOperation
Swift declaration
convenience init(query: CKQuery)
get · iOS 8.0+

cursor

TypeScript
get cursor(): (CKQueryOperation_Cursor) | null
Swift declaration
@NSCopying var cursor: CKQueryOperation.Cursor? { get set }
set · iOS 8.0+

cursor

TypeScript
set cursor(value: (CKQueryOperation_Cursor) | null)
Swift declaration
@NSCopying var cursor: CKQueryOperation.Cursor? { get set }
get · iOS 8.0+

query

TypeScript
get query(): (CKQuery) | null
Swift declaration
@NSCopying var query: CKQuery? { get set }
set · iOS 8.0+

query

TypeScript
set query(value: (CKQuery) | null)
Swift declaration
@NSCopying var query: CKQuery? { get set }
get · iOS 8.0+ · Deprecated in iOS 15.0

queryCompletionBlock

TypeScript
get queryCompletionBlock(): (((arg0: (CKQueryOperation_Cursor) | null, arg1: (NativeError) | null) => Promise<void>)) | null
Swift declaration
var queryCompletionBlock: ((CKQueryOperation.Cursor?, (any Error)?) -> Void)? { get set }
set · iOS 8.0+ · Deprecated in iOS 15.0

queryCompletionBlock

TypeScript
set queryCompletionBlock(value: (((arg0: (CKQueryOperation_Cursor) | null, arg1: (NativeError) | null) => void)) | null)
Swift declaration
var queryCompletionBlock: ((CKQueryOperation.Cursor?, (any Error)?) -> Void)? { get set }
get · iOS 8.0+ · Deprecated in iOS 15.0

recordFetchedBlock

TypeScript
get recordFetchedBlock(): (((arg0: CKRecord) => Promise<void>)) | null
Swift declaration
var recordFetchedBlock: ((CKRecord) -> Void)? { get set }
set · iOS 8.0+ · Deprecated in iOS 15.0

recordFetchedBlock

TypeScript
set recordFetchedBlock(value: (((arg0: CKRecord) => void)) | null)
Swift declaration
var recordFetchedBlock: ((CKRecord) -> Void)? { get set }
get · iOS 8.0+

resultsLimit

TypeScript
get resultsLimit(): number
Swift declaration
var resultsLimit: Int { get set }
set · iOS 8.0+

resultsLimit

TypeScript
set resultsLimit(value: number)
Swift declaration
var resultsLimit: Int { get set }
get · iOS 8.0+

zoneID

TypeScript
get zoneID(): (CKRecordZone_ID) | null
Swift declaration
@NSCopying var zoneID: CKRecordZone.ID? { get set }
set · iOS 8.0+

zoneID

TypeScript
set zoneID(value: (CKRecordZone_ID) | null)
Swift declaration
@NSCopying var zoneID: CKRecordZone.ID? { get set }
get · iOS 8.0+

desiredKeys

TypeScript
get desiredKeys(): (Array<string>) | null
Swift declaration
var desiredKeys: [CKRecord.FieldKey]? { get set }

The fields of the records to fetch. Use this property to limit the amount of data that CloudKit returns for each record. When CloudKit returns a record, it only includes fields with names that match one of the keys in this property. The property's default value is `nil`, which instructs CloudKit to return all of a record's keys. If you intend to specify a value other than `nil`, do so before you execute the operation or add the operation to a queue.

set · iOS 8.0+

desiredKeys

TypeScript
set desiredKeys(value: (Array<string>) | null)
Swift declaration
var desiredKeys: [CKRecord.FieldKey]? { get set }

The fields of the records to fetch. Use this property to limit the amount of data that CloudKit returns for each record. When CloudKit returns a record, it only includes fields with names that match one of the keys in this property. The property's default value is `nil`, which instructs CloudKit to return all of a record's keys. If you intend to specify a value other than `nil`, do so before you execute the operation or add the operation to a queue.

get · iOS 15.0+

queryResultBlock

TypeScript
get queryResultBlock(): (((arg0: SDKHandle) => Promise<void>)) | null
Swift declaration
var queryResultBlock: ((Result<CKQueryOperation.Cursor?, any Error>) -> Void)? { get set }

The closure to execute after CloudKit retrieves all of the records. The closure returns no value and takes the following parameter: - A <doc://com.apple.documentation/documentation/swift/result> that contains either: - A successful `Result`, or - An error that contains information about a problem encountered retrieving the results. This closure executes only once, and represents your final opportunity to process the results. It executes after all of the individual record match closures. The closure executes serially with respect to the other closures of the operation. If the number of records that the operation intends to return exceeds ``CKQueryOperation/resultsLimit``, the successful result provides a cursor that you can use to retrieve the next batch of results. You must create a separate operation using the cursor to fetch the next batch of results. Update the value of this property before you execute the operation or submit it to a queue.

set · iOS 15.0+

queryResultBlock

TypeScript
set queryResultBlock(value: (((arg0: SDKHandle) => void)) | null)
Swift declaration
var queryResultBlock: ((Result<CKQueryOperation.Cursor?, any Error>) -> Void)? { get set }

The closure to execute after CloudKit retrieves all of the records. The closure returns no value and takes the following parameter: - A <doc://com.apple.documentation/documentation/swift/result> that contains either: - A successful `Result`, or - An error that contains information about a problem encountered retrieving the results. This closure executes only once, and represents your final opportunity to process the results. It executes after all of the individual record match closures. The closure executes serially with respect to the other closures of the operation. If the number of records that the operation intends to return exceeds ``CKQueryOperation/resultsLimit``, the successful result provides a cursor that you can use to retrieve the next batch of results. You must create a separate operation using the cursor to fetch the next batch of results. Update the value of this property before you execute the operation or submit it to a queue.

get · iOS 15.0+

recordMatchedBlock

TypeScript
get recordMatchedBlock(): (((arg0: CKRecord_ID, arg1: SDKHandle) => Promise<void>)) | null
Swift declaration
var recordMatchedBlock: ((CKRecord.ID, Result<CKRecord, any Error>) -> Void)? { get set }

The closure to execute when a record match is available. The closure returns no value and takes the following parameters: - The ID of the record. - A <doc://com.apple.documentation/documentation/swift/result> that contains either a retrieved record, or an error that describes why CloudKit can't retrieve the record. After identifying and sorting the records, the query operation executes this closure once for each of the result's records. The closure executes serially with respect to all other closures of the operation, so you can expect only one closure at a time to execute for this operation. Set the property's value before you execute the operation or submit it to a queue. - Warning: Query indexes update asynchronously so they aren't always current. If you query for records that you recently changed and don't allow enough time for those changes to process, the query's results may be incorrect. The results may not contain the correct records, and the records may be out of order.

set · iOS 15.0+

recordMatchedBlock

TypeScript
set recordMatchedBlock(value: (((arg0: CKRecord_ID, arg1: SDKHandle) => void)) | null)
Swift declaration
var recordMatchedBlock: ((CKRecord.ID, Result<CKRecord, any Error>) -> Void)? { get set }

The closure to execute when a record match is available. The closure returns no value and takes the following parameters: - The ID of the record. - A <doc://com.apple.documentation/documentation/swift/result> that contains either a retrieved record, or an error that describes why CloudKit can't retrieve the record. After identifying and sorting the records, the query operation executes this closure once for each of the result's records. The closure executes serially with respect to all other closures of the operation, so you can expect only one closure at a time to execute for this operation. Set the property's value before you execute the operation or submit it to a queue. - Warning: Query indexes update asynchronously so they aren't always current. If you query for records that you recently changed and don't allow enough time for those changes to process, the query's results may be incorrect. The results may not contain the correct records, and the records may be out of order.

Skipped declarations

No declarations were skipped in this snapshot.

All CloudKit types →