An object that allows CloudKit operations to be grouped to align with user actions.


class CKOperationGroup : NSObject


In certain situations, several CloudKit operations warrant being performed as if they were an atomic operation. For example, when building a Calendar app, you group the following actions:

  • Performing an initial fetch of data from the server, consisting of numerous queries that fetch changes and new objects

  • Performing an incremental fetch of data in response to a push notification

  • Saving several records due to a user saving a calendar event

You associate CKOperationGroup objects with CKOperation objects by setting the group property. Create a new CKOperationGroup object for each distinct user action.


Creating an Operation Group


Initializes and returns an operation group object.

init(coder: NSCoder)

Initializes and returns an operation group object from data in the coder provided.

Creating a Configuration Group

var defaultConfiguration: CKOperation.Configuration!

The default configuration that is applied to operations contained in this group.

var expectedReceiveSize: CKOperationGroup.TransferSize

Estimated size of traffic being downloaded from CloudKit.

var expectedSendSize: CKOperationGroup.TransferSize

Estimated size of traffic being uploaded to CloudKit.

var name: String?

The name of the operation group.

var operationGroupID: String

The unique identifier for the operation group.

var quantity: Int

number of elements associated with the operation group.


Inherits From

See Also

Grouping Operation Execution

class CKOperation.Configuration

A collection of properties that describes how a CloudKit operation should behave.