Contents

fetch(withRecordZoneID:completionHandler:)

Fetches a specific record zone.

Declaration

func fetch(withRecordZoneID zoneID: CKRecordZone.ID, completionHandler: @escaping  @Sendable (CKRecordZone?, (any Error)?) -> Void)
func recordZone(for zoneID: CKRecordZone.ID) async throws -> CKRecordZone

Parameters

  • zoneID:

    The identifier of the record zone to fetch.

  • completionHandler:

    The closure to execute with the fetch results.

Discussion

The completion handler takes the following parameters:

  • The fetched record zone, or nil if there’s an error.

  • An error if a problem occurs, or nil if CloudKit successfully fetches the specified record zone.

For information on a more convenient way to fetch specific record zones, see recordZones(for:) in Swift or CKFetchRecordZonesOperation in Objective-C.

See Also

Fetching Record Zones