<!--
{
  "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/CKSyncEngineConfiguration/initWithDatabase:stateSerialization:delegate:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKSyncEngineConfiguration(im)initWithDatabase:stateSerialization:delegate:"
  },
  "title" : "initWithDatabase:stateSerialization:delegate:"
}
-->

# initWithDatabase:stateSerialization:delegate:

Creates a configuration for the specified database and serialized state.

```
- (instancetype) initWithDatabase:(CKDatabase *) database stateSerialization:(CKSyncEngineStateSerialization *) stateSerialization delegate:(id<CKSyncEngineDelegate>) delegate;
```

## Parameters

`database`

The database to sync — either a person’s private database or their shared database.

`stateSerialization`

If this is the first initialization of the associated sync engine, specify `nil`; otherwise, specify the state from the most recent [`CKSyncEngineStateUpdateEvent`](/documentation/CloudKit/CKSyncEngineStateUpdateEvent) that your delegate handled.

`delegate`

The object that provides the records to sync and handles any related events.

## Return Value

An initialized configuration instance.

---

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)