CCKDatabase

public protocol CCKDatabase

A protocol used to abstract a CKDatabase.

Invoke the extension methods on your CKDatabase instances in order to create Publishers.

See also

CloudKit

See also

Combine
  • Implemented by CKDatabase.

    See also

    delete

    Declaration

    Swift

    func delete(
      withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord.ID?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    delete

    Declaration

    Swift

    func delete(
      withRecordZoneID zoneID: CKRecordZone.ID,
      completionHandler: @escaping (CKRecordZone.ID?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    delete

    Declaration

    Swift

    func delete(
      withSubscriptionID subscriptionID: CKSubscription.ID,
      completionHandler: @escaping (String?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    fetch

    Declaration

    Swift

    func fetch(
      withRecordID recordID: CKRecord.ID, completionHandler: @escaping (CKRecord?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    fetch

    Declaration

    Swift

    func fetch(
      withRecordZoneID zoneID: CKRecordZone.ID,
      completionHandler: @escaping (CKRecordZone?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    fetch

    Declaration

    Swift

    func fetch(
      withSubscriptionID subscriptionID: CKSubscription.ID,
      completionHandler: @escaping (CKSubscription?, Error?) -> Void)
  • Implemented by CKDatabase.

    Declaration

    Swift

    func fetchAllRecordZones(completionHandler: @escaping ([CKRecordZone]?, Error?) -> Void)
  • Implemented by CKDatabase.

    Declaration

    Swift

    func fetchAllSubscriptions(completionHandler: @escaping ([CKSubscription]?, Error?) -> Void)
  • Implemented by CKDatabase.

    Declaration

    Swift

    func perform(
      _ query: CKQuery,
      inZoneWith zoneID: CKRecordZone.ID?,
      completionHandler: @escaping ([CKRecord]?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    save

    Declaration

    Swift

    func save(_ record: CKRecord, completionHandler: @escaping (CKRecord?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    save

    Declaration

    Swift

    func save(_ zone: CKRecordZone, completionHandler: @escaping (CKRecordZone?, Error?) -> Void)
  • Implemented by CKDatabase.

    See also

    save

    Declaration

    Swift

    func save(
      _ subscription: CKSubscription, completionHandler: @escaping (CKSubscription?, Error?) -> Void)
  • Saves a single record.

    Declaration

    Swift

    public func save(
      record: CKRecord,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    record

    The record to save to the database.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the saved CKRecord, or an error if CombineCloudKit can’t save it.

  • Saves multiple records.

    Declaration

    Swift

    public func save(
      records: [CKRecord],
      atomically isAtomic: Bool = true,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    records

    The records to save to the database.

    isAtomic

    A Boolean value that indicates whether the entire operation fails when CloudKit can’t save one or more records in a record zone.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the saved CKRecords, or an error if CombineCloudKit can’t save them.

  • Saves a single record.

    Note

    CombineCloudKit executes the save with a low priority. Use this method when you don’t require the save to happen immediately.

    See also

    save

    Declaration

    Swift

    public func saveAtBackgroundPriority(record: CKRecord) -> AnyPublisher<CKRecord, Error>

    Parameters

    record

    The record to save to the database.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKRecord, or an error if CombineCloudKit can’t save it. The publisher ignores requests for cooperative cancellation.

  • Saves a single record.

    Declaration

    Swift

    public func saveWithProgress(
      record: CKRecord,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<(CKRecord, Progress), Error>

    Parameters

    record

    The record to save to the database.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the Progress of the saved CKRecord, or an error if CombineCloudKit can’t save it.

  • Saves multiple records.

    Declaration

    Swift

    public func saveWithProgress(
      records: [CKRecord],
      atomically isAtomic: Bool = true,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<(CKRecord, Progress), Error>

    Parameters

    records

    The records to save to the database.

    isAtomic

    A Boolean value that indicates whether the entire operation fails when CloudKit can’t save one or more records in a record zone.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the Progress of the saved CKRecords, or an error if CombineCloudKit can’t save them.

  • Deletes a single record.

    Declaration

    Swift

    public func delete(
      recordID: CKRecord.ID,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord.ID, Error>

    Parameters

    recordID

    The ID of the record to delete permanently from the database.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKRecord.ID, or an error if CombineCloudKit can’t delete it.

  • Deletes multiple records.

    Declaration

    Swift

    public func delete(
      recordIDs: [CKRecord.ID],
      atomically isAtomic: Bool = true,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord.ID, Error>

    Parameters

    recordIDs

    The IDs of the records to delete permanently from the database.

    isAtomic

    A Boolean value that indicates whether the entire operation fails when CloudKit can’t delete one or more records in a record zone.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKRecord.IDs, or an error if CombineCloudKit can’t delete them.

  • Deletes a single record.

    Note

    CombineCloudKit executes the delete with a low priority. Use this method when you don’t require the delete to happen immediately.

    See also

    delete

    Declaration

    Swift

    public func deleteAtBackgroundPriority(recordID: CKRecord.ID)
      -> AnyPublisher<CKRecord.ID, Error>

    Parameters

    recordID

    The ID of the record to delete permanently from the database.

    Return Value

    A Publisher that emits the deleted CKRecord.ID, or an error if CombineCloudKit can’t delete it. The publisher ignores requests for cooperative cancellation.

  • Modifies one or more records.

    Declaration

    Swift

    public func modify(
      recordsToSave: [CKRecord]? = nil,
      recordIDsToDelete: [CKRecord.ID]? = nil,
      atomically isAtomic: Bool = true,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<(CKRecord?, CKRecord.ID?), Error>

    Parameters

    recordsToSave

    The records to save to the database.

    recordsToDelete

    The IDs of the records to delete permanently from the database.

    isAtomic

    A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the saved CKRecords and the deleted CKRecord.IDs.

  • Modifies one or more records.

    Declaration

    Swift

    public func modifyWithProgress(
      recordsToSave: [CKRecord]? = nil,
      recordIDsToDelete: [CKRecord.ID]? = nil,
      atomically isAtomic: Bool = true,
      withConfiguration configuration: CKOperation.Configuration? = nil,
      savePolicy: CKModifyRecordsOperation.RecordSavePolicy = .ifServerRecordUnchanged,
      clientChangeTokenData: Data? = nil
    ) -> AnyPublisher<((CKRecord, Progress)?, CKRecord.ID?), Error>

    Parameters

    recordsToSave

    The records to save to the database.

    recordsToDelete

    The IDs of the records to delete permanently from the database.

    isAtomic

    A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    savePolicy

    The policy to apply when the server contains a newer version of a specific record.

    clientChangeTokenData

    A token that tracks local changes to records.

    Return Value

    A Publisher that emits the Progress of the saved CKRecords, and the deleted CKRecord.IDs.

  • Fetches the record with the specified ID.

    Declaration

    Swift

    public func fetch(
      recordID: CKRecord.ID,
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    recordID

    The record ID of the record to fetch.

    desiredKeys

    The fields of the record to fetch. Use this parameter to limit the amount of data that CloudKit returns for the record. When CloudKit returns the record, it only includes fields with names that match one of the keys in this parameter. The parameter’s default value is nil, which instructs CloudKit to return all of the record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the fetched CKRecord, or an error if CombineCloudKit can’t fetch it.

  • Fetches multiple records.

    Declaration

    Swift

    public func fetch(
      recordIDs: [CKRecord.ID],
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    recordIDs

    The record IDs of the records to fetch.

    desiredKeys

    The fields of the records to fetch. Use this parameter 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 parameter. The parameter’s default value is nil, which instructs CloudKit to return all of a record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the fetched CKRecords, or an error if CombineCloudKit can’t fetch them.

  • Fetches the record with the specified ID.

    Note

    CombineCloudKit executes the fetch with a low priority. Use this method when you don’t require the record immediately.

    See also

    fetch

    Declaration

    Swift

    public func fetchAtBackgroundPriority(
      withRecordID recordID: CKRecord.ID
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    recordID

    The record ID of the record to fetch.

    Return Value

    A Publisher that emits the CKRecord, or an error if CombineCloudKit can’t fetch it. The publisher ignores requests for cooperative cancellation.

  • Fetches the record with the specified ID.

    Declaration

    Swift

    public func fetchWithProgress(
      recordID: CKRecord.ID,
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<((CKRecord.ID, Progress)?, CKRecord?), Error>

    Parameters

    recordID

    The record ID of the record to fetch.

    desiredKeys

    The fields of the record to fetch. Use this parameter to limit the amount of data that CloudKit returns for the record. When CloudKit returns the record, it only includes fields with names that match one of the keys in this parameter. The parameter’s default value is nil, which instructs CloudKit to return all of the record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits Progress and the fetched CKRecord on completion, or an error if CombineCloudKit can’t fetch it.

  • Fetches multiple records.

    Declaration

    Swift

    public func fetchWithProgress(
      recordIDs: [CKRecord.ID],
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<((CKRecord.ID, Progress)?, CKRecord?), Error>

    Parameters

    recordIDs

    The record IDs of the records to fetch.

    desiredKeys

    The fields of the records to fetch. Use this parameter 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 parameter. The parameter’s default value is nil, which instructs CloudKit to return all of a record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the Progress of the fetched CKRecord.IDs and the fetched CKRecords, or an error if CombineCloudKit can’t fetch them.

  • Fetches the current user record.

    Declaration

    Swift

    public func fetchCurrentUserRecord(
      desiredKeys _: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    desiredKeys

    The fields of the record to fetch. Use this parameter to limit the amount of data that CloudKit returns for the record. When CloudKit returns the record, it only includes fields with names that match one of the keys in this parameter. The parameter’s default value is nil, which instructs CloudKit to return all of the record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKRecord, or an error if CombineCloudKit can’t fetch it.

  • Fetches records that match the specified query.

    See also

    CKQuery

    See also

    CKQueryOperation

    See also

    NSPredicate

    See also

    NSSortDescriptor

    Declaration

    Swift

    public func performQuery(
      ofType recordType: CKRecord.RecordType,
      where predicate: NSPredicate = NSPredicate(value: true),
      orderBy sortDescriptors: [NSSortDescriptor]? = nil,
      inZoneWith zoneID: CKRecordZone.ID? = nil,
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    recordType

    The record type to search.

    predicate

    The predicate to use for matching records.

    sortDescriptors

    The sort descriptors for organizing the query’s results.

    zoneID

    The ID of the record zone that contains the records to search. The value of this parameter limits the scope of the search to only the records in the specified record zone. If you don’t specify a record zone, the search includes all record zones.

    desiredKeys

    The fields of the records to fetch. Use this parameter 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 parameter. The parameter’s default value is nil, which instructs CloudKit to return all of a record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits any matching CKRecords, or an error if CombineCloudKit can’t perform the query.

  • Fetches records that match the specified query.

    See also

    CKQuery

    See also

    CKQueryOperation

    See also

    NSPredicate

    See also

    NSSortDescriptor

    Declaration

    Swift

    public func perform(
      _ query: CKQuery,
      inZoneWith zoneID: CKRecordZone.ID? = nil,
      desiredKeys: [CKRecord.FieldKey]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecord, Error>

    Parameters

    query

    The query for the search.

    zoneID

    The ID of the record zone that contains the records to search. The value of this parameter limits the scope of the search to only the records in the specified record zone. If you don’t specify a record zone, the search includes all record zones.

    desiredKeys

    The fields of the records to fetch. Use this parameter 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 parameter. The parameter’s default value is nil, which instructs CloudKit to return all of a record’s keys.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits any matching CKRecords, or an error if CombineCloudKit can’t perform the query.

  • Saves a single record zone.

    Note

    CombineCloudKit executes the save with a low priority. Use this method when you don’t require the save to happen immediately.

    See also

    save

    Declaration

    Swift

    public func saveAtBackgroundPriority(
      recordZone: CKRecordZone
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZone

    The record zone to save.

    Return Value

    A Publisher that emits the saved CKRecordZone, or an error if CombineCloudKit can’t save it. The publisher ignores requests for cooperative cancellation.

  • Saves a single record zone.

    Declaration

    Swift

    public func save(
      recordZone: CKRecordZone,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZone

    The record zone to save.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKRecordZone, or an error if CombineCloudKit can’t save it.

  • Saves multiple record zones.

    Declaration

    Swift

    public func save(
      recordZones: [CKRecordZone],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZones

    The record zones to save.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKRecordZones, or an error if CombineCloudKit can’t save them.

  • Deletes a single record zone.

    Note

    CombineCloudKit executes the delete with a low priority. Use this method when you don’t require the delete to happen immediately.

    See also

    delete

    Declaration

    Swift

    public func deleteAtBackgroundPriority(
      recordZoneID: CKRecordZone.ID
    ) -> AnyPublisher<CKRecordZone.ID, Error>

    Parameters

    recordZoneID

    The ID of the record zone to delete.

    Return Value

    A Publisher that emits the deleted CKRecordZone.ID, or an error if CombineCloudKit can’t delete it. The publisher ignores requests for cooperative cancellation.

  • Deletes a single record zone.

    Declaration

    Swift

    public func delete(
      recordZoneID: CKRecordZone.ID,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone.ID, Error>

    Parameters

    recordZoneID

    The ID of the record zone to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKRecordZone.ID, or an error if CombineCloudKit can’t delete it.

  • Deletes multiple record zones.

    Declaration

    Swift

    public func delete(
      recordZoneIDs: [CKRecordZone.ID],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone.ID, Error>

    Parameters

    recordZoneIDs

    The IDs of the record zones to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKRecordZone.IDs, or an error if CombineCloudKit can’t delete them.

  • Modifies one or more record zones.

    Declaration

    Swift

    public func modify(
      recordZonesToSave: [CKRecordZone]? = nil,
      recordZoneIDsToDelete: [CKRecordZone.ID]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<(CKRecordZone?, CKRecordZone.ID?), Error>

    Parameters

    recordZonesToSave

    The record zones to save.

    recordZonesToDelete

    The IDs of the record zones to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKRecordZones and the deleted CKRecordZone.IDs, or an error if CombineCloudKit can’t modify them.

  • Fetches the record zone with the specified ID.

    Note

    CombineCloudKit executes the fetch with a low priority. Use this method when you don’t require the record zone immediately.

    See also

    fetch

    Declaration

    Swift

    public func fetchAtBackgroundPriority(
      withRecordZoneID recordZoneID: CKRecordZone.ID
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZoneID

    The ID of the record zone to fetch.

    Return Value

    A Publisher that emits the CKRecordZone, or an error if CombineCloudKit can’t fetch it. The publisher ignores requests for cooperative cancellation.

  • Fetches the record zone with the specified ID.

    Declaration

    Swift

    public func fetch(
      recordZoneID: CKRecordZone.ID,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZoneID

    The ID of the record zone to fetch.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKRecordZone, or an error if CombineCloudKit can’t fetch it.

  • Fetches multiple record zones.

    Declaration

    Swift

    public func fetch(
      recordZoneIDs: [CKRecordZone.ID],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    recordZoneIDs

    The IDs of the record zones to fetch.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKRecordZones, or an error if CombineCloudKit can’t fetch them.

  • Fetches the database’s record zones.

    Note

    CombineCloudKit executes the fetch with a low priority. Use this method when you don’t require the record zones immediately.

    Declaration

    Swift

    public func fetchAllRecordZonesAtBackgroundPriority()
      -> AnyPublisher<CKRecordZone, Error>

    Return Value

    A Publisher that emits the CKRecordZones, or an error if CombineCloudKit can’t fetch them.

  • Fetches the database’s record zones.

    Declaration

    Swift

    public func fetchAllRecordZones(
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKRecordZone, Error>

    Parameters

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKRecordZones, or an error if CombineCloudKit can’t fetch them.

  • Saves a single subscription.

    Note

    CombineCloudKit executes the save with a low priority. Use this method when you don’t require the save to happen immediately.

    See also

    save

    Declaration

    Swift

    public func saveAtBackgroundPriority(
      subscription: CKSubscription
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscription

    The subscription to save.

    Return Value

    A Publisher that emits the saved CKSubscription, or an error if CombineCloudKit can’t save it. The publisher ignores requests for cooperative cancellation.

  • Saves a single subscription.

    Declaration

    Swift

    public func save(
      subscription: CKSubscription,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscription

    The subscription to save.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKSubscription, or an error if CombineCloudKit can’t save it.

  • Saves multiple subscriptions.

    Declaration

    Swift

    public func save(
      subscriptions: [CKSubscription],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscriptions

    The subscriptions to save.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKSubscriptions, or an error if CombineCloudKit can’t save them.

  • Deletes a single subscription.

    Note

    CombineCloudKit executes the delete with a low priority. Use this method when you don’t require the delete to happen immediately.

    See also

    delete

    Declaration

    Swift

    public func deleteAtBackgroundPriority(
      subscriptionID: CKSubscription.ID
    ) -> AnyPublisher<CKSubscription.ID, Error>

    Parameters

    subscriptionID

    The ID of the subscription to delete.

    Return Value

    A Publisher that emits the deleted CKSubscription.ID, or an error if CombineCloudKit can’t delete it.

  • Deletes a single subscription.

    Declaration

    Swift

    public func delete(
      subscriptionID: CKSubscription.ID,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription.ID, Error>

    Parameters

    subscriptionID

    The ID of the subscription to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKSubscription.ID, or an error if CombineCloudKit can’t delete it.

  • Deletes multiple subscriptions.

    Declaration

    Swift

    public func delete(
      subscriptionIDs: [CKSubscription.ID],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription.ID, Error>

    Parameters

    subscriptionIDs

    The IDs of the subscriptions to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the deleted CKSubscription.IDs, or an error if CombineCloudKit can’t delete them.

  • Modifies one or more subscriptions.

    Declaration

    Swift

    public func modify(
      subscriptionsToSave: [CKSubscription]? = nil,
      subscriptionIDsToDelete: [CKSubscription.ID]? = nil,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<(CKSubscription?, CKSubscription.ID?), Error>

    Parameters

    subscriptionsToSave

    The subscriptions to save.

    subscriptionsToDelete

    The IDs of the subscriptions to delete.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the saved CKSubscriptions and the deleted CKSubscription.IDs, or an error if CombineCloudKit can’t modify them.

  • Fetches the subscription with the specified ID.

    Note

    CombineCloudKit executes the fetch with a low priority. Use this method when you don’t require the subscription immediately.

    See also

    fetch

    Declaration

    Swift

    public func fetchAtBackgroundPriority(
      withSubscriptionID subscriptionID: CKSubscription.ID
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscriptionID

    The ID of the subscription to fetch.

    Return Value

    A Publisher that emits the CKSubscription, or an error if CombineCloudKit can’t fetch it. The publisher ignores requests for cooperative cancellation.

  • Fetches the subscription with the specified ID.

    Declaration

    Swift

    public func fetch(
      subscriptionID: CKSubscription.ID,
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscriptionID

    The ID of the subscription to fetch.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKSubscription, or an error if CombineCloudKit can’t fetch it.

  • Fetches multiple subscriptions.

    Declaration

    Swift

    public func fetch(
      subscriptionIDs: [CKSubscription.ID],
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    subscriptionIDs

    The IDs of the subscriptions to fetch.

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKSubscriptions, or an error if CombineCloudKit can’t fetch them.

  • Fetches the database’s subscriptions.

    Note

    CombineCloudKit executes the fetch with a low priority. Use this method when you don’t require the subscriptions immediately.

    Declaration

    Swift

    public func fetchAllSubscriptionsAtBackgroundPriority()
      -> AnyPublisher<CKSubscription, Error>

    Return Value

    A Publisher that emits the CKSubscriptions, or an error if CombineCloudKit can’t fetch them. The publisher ignores requests for cooperative cancellation.

  • Fetches the database’s subscriptions.

    Declaration

    Swift

    public func fetchAllSubscriptions(
      withConfiguration configuration: CKOperation.Configuration? = nil
    ) -> AnyPublisher<CKSubscription, Error>

    Parameters

    configuration

    The configuration to use for the underlying operation. If you don’t specify a configuration, the operation will use a default configuration.

    Return Value

    A Publisher that emits the CKSubscriptions, or an error if CombineCloudKit can’t fetch them.