<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKSyncEngine-5sie5/Event/AccountChange",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:8CloudKit12CKSyncEngineC5EventO13AccountChangeV"
  },
  "title" : "CKSyncEngine.Event.AccountChange"
}
-->

# CKSyncEngine.Event.AccountChange

The user signed in or out of their account.

```
struct AccountChange
```

## Overview

The sync engine automatically listens for account changes, and it sends this event when the user signs in or out.
It’s your responsibility to react appropriately to this change and update your local persistence.

When the logged-in account changes, the sync engine resets its internal state.
This means that it clears any pending database or record zone changes that you may have added.

Note that it’s possible the account changes multiple times while your app is quit.
If this happens, you only receive one account change event representing the transition between the last known state and the current state.

> Important: When a sync engine detects a change to the device’s iCloud account, it resets its internal state, including unsaved changes to both records and record zones. Your app needs to handle this scenario gracefully.

## Topics

### Understanding the change

[`let changeType: CKSyncEngine.Event.AccountChange.ChangeType`](/documentation/CloudKit/CKSyncEngine-5sie5/Event/AccountChange/changeType-swift.property)

The iCloud account’s change type.

[`enum ChangeType`](/documentation/CloudKit/CKSyncEngine-5sie5/Event/AccountChange/ChangeType-swift.enum)

Describes a change to the device’s iCloud account.

[`enum CKSyncEngineAccountChangeType`](/documentation/CloudKit/CKSyncEngineAccountChangeType)

Describes a change to the device’s iCloud account.

### Debugging the event

[`var description: String`](/documentation/CloudKit/CKSyncEngine-5sie5/Event/AccountChange/description)

A textual description of the event that’s suitable for logging.

### Default Implementations

[CustomStringConvertible Implementations](/documentation/CloudKit/CKSyncEngine-5sie5/Event/AccountChange/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Escapable`](/documentation/Swift/Escapable)

---

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)