<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKSyncEngine-4b4w9/sendChangesWithOptions:completionHandler:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKSyncEngine(im)sendChangesWithOptions:completionHandler:"
  },
  "title" : "sendChangesWithOptions:completionHandler:"
}
-->

# sendChangesWithOptions:completionHandler:

Sends pending local changes to the server using the specified options.

```
- (void) sendChangesWithOptions:(CKSyncEngineSendChangesOptions *) options completionHandler:(void (^)(NSError *error)) completionHandler;
```

## Parameters

`options`

The options to use when sending changes. For more information, see [`CKSyncEngineSendChangesOptions`](/documentation/CloudKit/CKSyncEngineSendChangesOptions).

`completionHandler`

The block to execute when the send completes.

## Discussion

If the send fails, the completion handler’s `error` parameter is an object that describes that failure; otherwise, it’s `nil`.

Use this method to request the sync engine sends all pending local changes to the server before your app continues.
This isn’t necessary in normal use, as the engine automatically syncs your app’s records.
It is useful, however, in scenarios where you require greater control over sync, such as a “Backup now” button or unit tests.

> Note: The sync engine invokes the completion handler only after your sync delegate finishes processing all related send events.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)