---
title: "initializeCloudKitSchema(options:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nspersistentcloudkitcontainer/initializecloudkitschema(options:)"
---

# initializeCloudKitSchema(options:)

Creates the CloudKit schema for all stores in the container that manage a CloudKit database.

## Declaration

```swift
func initializeCloudKitSchema(options: NSPersistentCloudKitContainerSchemaInitializationOptions = []) throws
```

## Parameters

- `options`: The options to use when creating the CloudKit schema.

## Discussion

Discussion To create the schema, this method creates a set of representative CKRecord instances for all stores in the container that use Core Data with CloudKit, and uploads them to CloudKit. These records have a representative value for every field Core Data might serialize for the specified managed object model. After successfully uploading the records, the schema is visible in the CloudKit Dashboard and the container deletes the representative records. note: This method also validates the managed object model in use for a store, so if the model isn’t valid for use with CloudKit, a validation error may return.

## See Also

### Promoting Your Schema

- [NSPersistentCloudKitContainerSchemaInitializationOptions](coredata/nspersistentcloudkitcontainerschemainitializationoptions.md)
