---
title: "fetchChanges(_:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/cksyncengine-5sie5/fetchchanges(_:)"
---

# fetchChanges(_:)

Fetches pending remote changes from the server.

## Declaration

```swift
final func fetchChanges(_ options: CKSyncEngine.FetchChangesOptions = .init()) async throws
```

## Parameters

- `options`: The options to use when fetching changes. For more information, see doc://com.apple.cloudkit/documentation/CloudKit/CKSyncEngine-5sie5/FetchChangesOptions.

## Discussion

Discussion Use this method to request the sync engine immediately fetches all pending remote changes 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 more control over sync, such as pull-to-refresh or unit tests. note: fetchChanges(_:) returns only after your sync delegate finishes processing all related fetch events. note: An error if the fetch operation fails. Common errors include network failures, authentication issues, or server-side problems.

## See Also

### Invoking manual sync operations

- [CKSyncEngine.FetchChangesOptions](cloudkit/cksyncengine-5sie5/fetchchangesoptions.md)
- [sendChanges(_:)](cloudkit/cksyncengine-5sie5/sendchanges(_:).md)
- [CKSyncEngine.SendChangesOptions](cloudkit/cksyncengine-5sie5/sendchangesoptions.md)
