Contents

save(_:completionHandler:)

Saves a specific record zone.

Declaration

func save(_ zone: CKRecordZone, completionHandler: @escaping  @Sendable (CKRecordZone?, (any Error)?) -> Void)
func save(_ zone: CKRecordZone) async throws -> CKRecordZone

Parameters

  • zone:

    The record zone to save.

  • completionHandler:

    The closure to execute after CloudKit saves the record.

Discussion

The completion handler takes the following parameters:

  • The saved record zone (as it appears on the server), or nil if there’s an error.

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

For information on a more convenient way to save record zones, see modifyRecordZones(saving:deleting:).

See Also

Modifying Record Zones