One Logo Pool Ball
CloudKit · IOS API REFERENCE

CKFetchSubscriptionsOperation

class · iOS 8.0+ · SDK 27.1

class CKFetchSubscriptionsOperation

Members (11)

static · iOS 8.0+

fetchAllSubscriptionsOperation

TypeScript
static fetchAllSubscriptionsOperation(): CKFetchSubscriptionsOperation
Swift declaration
class func fetchAllSubscriptionsOperation() -> Self
init · iOS 8.0+

init

TypeScript
static init(): CKFetchSubscriptionsOperation
Swift declaration
init()
get · iOS 15.0+

fetchSubscriptionsResultBlock

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

The closure to execute after CloudKit retrieves all of the subscriptions. This property is a closure that returns no value and has 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 subscriptions. The fetch operation executes this closure only once. The closure executes before the operation's completion closure. The closure executes serially with respect to the other closures of the operation. If you intend to use this closure to process results, set it before you execute the operation or submit the operation to a queue.

set · iOS 15.0+

fetchSubscriptionsResultBlock

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

The closure to execute after CloudKit retrieves all of the subscriptions. This property is a closure that returns no value and has 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 subscriptions. The fetch operation executes this closure only once. The closure executes before the operation's completion closure. The closure executes serially with respect to the other closures of the operation. If you intend to use this closure to process results, set it before you execute the operation or submit the operation to a queue.

init · iOS 8.0+

init

TypeScript
static initSubscriptionIDs(subscriptionIDs: Array<string>): CKFetchSubscriptionsOperation
Swift declaration
convenience init(subscriptionIDs: [CKSubscription.ID])

Creates an operation for fetching the specified subscriptions. - Parameters: - subscriptionIDs: An array of strings where each one is an ID of a subscription that you want to retrieve. This parameter sets the ``CKFetchSubscriptionsOperation/subscriptionIDs-714ct`` property's value. If you specify `nil`, you must set the `subscriptionIDs` property before you execute the operation. After creating the operation, assign a closure to the ``CKFetchSubscriptionsOperation/fetchSubscriptionCompletionBlock-207ep`` property to process the results.

get · iOS 8.0+

subscriptionIDs

TypeScript
get subscriptionIDs(): (Array<string>) | null
Swift declaration
var subscriptionIDs: [CKSubscription.ID]? { get set }

The IDs of the subscriptions to fetch. Use this property to view or change the IDs of the subscriptions to fetch. Each element of the array is a string that represents the ID of a subscription. If you intend to modify this property's value, do so before you execute the operation or submit it to a queue. If you use the ``CKFetchSubscriptionsOperation/fetchAllSubscriptionsOperation()`` method to create the operation, CloudKit ignores this property's value and sets it to `nil`.

set · iOS 8.0+

subscriptionIDs

TypeScript
set subscriptionIDs(value: (Array<string>) | null)
Swift declaration
var subscriptionIDs: [CKSubscription.ID]? { get set }

The IDs of the subscriptions to fetch. Use this property to view or change the IDs of the subscriptions to fetch. Each element of the array is a string that represents the ID of a subscription. If you intend to modify this property's value, do so before you execute the operation or submit it to a queue. If you use the ``CKFetchSubscriptionsOperation/fetchAllSubscriptionsOperation()`` method to create the operation, CloudKit ignores this property's value and sets it to `nil`.

get · iOS 15.0+

perSubscriptionResultBlock

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

The closure to execute when a subscription becomes available. This property is a closure that returns no value and has the following parameters: - The ID of the subscription. - A <doc://com.apple.documentation/documentation/swift/result> that contains either a retrieved subscription, or an error that describes why CloudKit can't retrieve the subscription. The fetch operation executes this closure once for each subscription ID in the ``CKFetchSubscriptionsOperation/subscriptionIDs-17f4q`` property. Each time the closure executes, it executes serially with respect to the other closures of the operation. If you intend to use this closure to process results, set it before you execute the operation or submit the operation to a queue.

set · iOS 15.0+

perSubscriptionResultBlock

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

The closure to execute when a subscription becomes available. This property is a closure that returns no value and has the following parameters: - The ID of the subscription. - A <doc://com.apple.documentation/documentation/swift/result> that contains either a retrieved subscription, or an error that describes why CloudKit can't retrieve the subscription. The fetch operation executes this closure once for each subscription ID in the ``CKFetchSubscriptionsOperation/subscriptionIDs-17f4q`` property. Each time the closure executes, it executes serially with respect to the other closures of the operation. If you intend to use this closure to process results, set it before you execute the operation or submit the operation to a queue.

get · iOS 8.0+ · Deprecated in iOS 15.0

fetchSubscriptionCompletionBlock

TypeScript
get fetchSubscriptionCompletionBlock(): (((arg0: (Record<string, CKSubscription>) | null, arg1: (NativeError) | null) => Promise<void>)) | null
Swift declaration
var fetchSubscriptionCompletionBlock: (([CKSubscription.ID : CKSubscription]?, (any Error)?) -> Void)? { get set }

The block to execute with the fetch results. The closure returns no value and takes the following parameters: - A dictionary with keys that are the IDs of the subscriptions you request, and values that are the corresponding subscriptions. - An error that contains information about a problem, or `nil` if the system successfully fetches the subscriptions. The operation executes this closure only once, and it's your only opportunity to process the results. The closure executes on a background queue, so any tasks that require access to the main queue must dispatch accordingly. The closure reports an error of type ``CKError/Code/partialFailure`` when it retrieves only some of the subscriptions successfully. The <doc://com.apple.documentation/documentation/foundation/nserror/userinfo> dictionary of the error contains a ``CKPartialErrorsByItemIDKey`` key that has a dictionary as its value. The keys of the dictionary are the IDs of the subscriptions that the operation can't fetch, and the corresponding values are errors that contain information about the failures. Set this property's value before you execute the operation or submit it to a queue.

set · iOS 8.0+ · Deprecated in iOS 15.0

fetchSubscriptionCompletionBlock

TypeScript
set fetchSubscriptionCompletionBlock(value: (((arg0: (Record<string, CKSubscription>) | null, arg1: (NativeError) | null) => void)) | null)
Swift declaration
var fetchSubscriptionCompletionBlock: (([CKSubscription.ID : CKSubscription]?, (any Error)?) -> Void)? { get set }

The block to execute with the fetch results. The closure returns no value and takes the following parameters: - A dictionary with keys that are the IDs of the subscriptions you request, and values that are the corresponding subscriptions. - An error that contains information about a problem, or `nil` if the system successfully fetches the subscriptions. The operation executes this closure only once, and it's your only opportunity to process the results. The closure executes on a background queue, so any tasks that require access to the main queue must dispatch accordingly. The closure reports an error of type ``CKError/Code/partialFailure`` when it retrieves only some of the subscriptions successfully. The <doc://com.apple.documentation/documentation/foundation/nserror/userinfo> dictionary of the error contains a ``CKPartialErrorsByItemIDKey`` key that has a dictionary as its value. The keys of the dictionary are the IDs of the subscriptions that the operation can't fetch, and the corresponding values are errors that contain information about the failures. Set this property's value before you execute the operation or submit it to a queue.

Skipped declarations

No declarations were skipped in this snapshot.

All CloudKit types →