Initializer

init(recordType:predicate:options:)

Initializes and returns a query-based subscription that monitors records with the specified options.

Declaration

init(recordType: String, predicate: NSPredicate, options subscriptionOptions: CKSubscriptionOptions = [])

Parameters

recordType

The string that identifies the type of records to track. You are responsible for naming your app’s record types. This parameter must not be nil or an empty string.

predicate

The matching criteria to apply to the records. This parameter must not be nil. For information about the operators that are supported in search predicates, see the discussion in CKQuery.

subscriptionOptions

A bitmask of the configuration options for the subscription. You must specify at least one of the following values: firesOnRecordCreation, firesOnRecordUpdate, or firesOnRecordDeletion.

Return Value

A subscription object initialized to track record-related changes.

Discussion

The object returned by this method is configured as a query-based subscription for searching records in the target database. The subscription monitors the specified type of records in all of the user’s record zones and generates push notifications when the search criteria are met.

See Also

Initializing a Query-Based Subscription

init(recordType: String, predicate: NSPredicate, subscriptionID: String, options: CKSubscriptionOptions)

Initializes and returns a query-based subscription object that monitors records and has a specific name.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software