One Logo Pool Ball
CloudKit · IOS API REFERENCE

CKQuery

class · iOS 8.0+ · SDK 27.1

class CKQuery

Members (6)

init · iOS 8.0+

init

TypeScript
static initCoder(aDecoder: _Foundation_NSCoder): CKQuery
Swift declaration
init(coder aDecoder: NSCoder)
get · iOS 8.0+

predicate

TypeScript
get predicate(): _Foundation_NSPredicate
Swift declaration
@NSCopying var predicate: NSPredicate { get }
get · iOS 8.0+

sortDescriptors

TypeScript
get sortDescriptors(): (Array<_Foundation_NSSortDescriptor>) | null
Swift declaration
var sortDescriptors: [NSSortDescriptor]? { get set }
set · iOS 8.0+

sortDescriptors

TypeScript
set sortDescriptors(value: (Array<_Foundation_NSSortDescriptor>) | null)
Swift declaration
var sortDescriptors: [NSSortDescriptor]? { get set }
init · iOS 8.0+

init

TypeScript
static initRecordTypePredicate(recordType: string, predicate: _Foundation_NSPredicate): CKQuery
Swift declaration
convenience init(recordType: CKRecord.RecordType, predicate: NSPredicate)

Creates a query with the specified record type and predicate. - Parameters: - recordType: The type of record to search. Specify the name of one of your app's supported record types. The method throws an exception if this parameter is an empty string. - predicate: The search predicate to apply to the prospective records. Only records that match the predicate criteria appear in the search results. For guidelines on how to construct predicates for your queries, see <doc:CKQuery#Predicate-Rules-for-Query-Objects>. You can't change the record type and predicate of a query after you create it. If you want to search for a different set of records using a different set of search criteria, create a new query. You can add sort descriptors to the query and change them later as necessary. You can't query for user records, and executing a query where the record type is ``CKRecordTypeUserRecord-49k30`` results in an error. You must fetch user records directly using their IDs.

get · iOS 8.0+

recordType

TypeScript
get recordType(): string
Swift declaration
var recordType: CKRecord.RecordType { get }

The record type to search. A query's results include only records of the specified type. The record type is an app-specific string that you use to distinguish among the records of your app. The records of a particular type all represent different instances of the same information. For example, an employee record type might store the employee's name, phone number, and a reference to the employee's manager.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CKQuery.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All CloudKit types →