---
title: CKSyncEngine.Event.StateUpdate
framework: cloudkit
role: symbol
role_heading: Structure
path: cloudkit/cksyncengine-5sie5/event/stateupdate
---

# CKSyncEngine.Event.StateUpdate

The sync engine state was updated, and you should persist it locally.

## Declaration

```swift
struct StateUpdate
```

## Overview

Overview In order to function properly and efficiently, CKSyncEngine tracks some state internally. When the sync engine state changes, it gives you the latest serialized version in a CKSyncEngine.Event.StateUpdate event. This event happens occasionally when the sync engine modifies the state internally during normal sync operation. This event also happens when you change the state yourself. The sync engine does not persist this state to disk, so you need to persist it alongside your own local data. The next time your process launches, use this latest state serialization in stateSerialization to initialize your sync engine. This state is directly tied to the changes you fetch and send with the sync engine. You should persist this state alongside any changes fetched prior to receiving this state.

## Topics

### Accessing the state

- [stateSerialization](cloudkit/cksyncengine-5sie5/event/stateupdate/stateserialization.md)

### Debugging the event

- [description](cloudkit/cksyncengine-5sie5/event/stateupdate/description.md)

### Default Implementations

- [CustomStringConvertible Implementations](cloudkit/cksyncengine-5sie5/event/stateupdate/customstringconvertible-implementations.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### State updates

- [CKSyncEngine.Event.stateUpdate(_:)](cloudkit/cksyncengine-5sie5/event/stateupdate(_:).md)
