<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPersistentCloudKitContainer/initializeCloudKitSchema(options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersistentCloudKitContainer(im)initializeCloudKitSchemaWithOptions:error:"
  },
  "title" : "initializeCloudKitSchema(options:)"
}
-->

# initializeCloudKitSchema(options:)

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

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

## Parameters

`options`

The options to use when creating the CloudKit schema.

## Discussion

To create the schema, this method creates a set of representative <doc://com.apple.documentation/documentation/CloudKit/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.

---

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)