---
title: NSPersistentCloudKitContainer
framework: coredata
role: symbol
role_heading: Class
path: coredata/nspersistentcloudkitcontainer
---

# NSPersistentCloudKitContainer

A container that encapsulates the Core Data stack in your app, and mirrors select persistent stores to a CloudKit private database.

## Declaration

```swift
class NSPersistentCloudKitContainer
```

## Mentioned in

Setting Up Core Data with CloudKit Mirroring a Core Data store with CloudKit Reading CloudKit Records for Core Data

## Overview

Overview NSPersistentCloudKitContainer is a subclass of NSPersistentContainer capable of managing both CloudKit-backed and noncloud stores. By default, NSPersistentCloudKitContainer contains a single store description, which Core Data assigns to the first CloudKit container identifier in an app’s entitlements. Use NSPersistentCloudKitContainerOptions to customize this behavior or create additional store descriptions with backing by different containers. For more information about setting up multiple stores, see Setting Up Core Data with CloudKit.

## Topics

### Checking Permissions

- [canUpdateRecord(forManagedObjectWith:)](coredata/nspersistentcloudkitcontainer/canupdaterecord(formanagedobjectwith:).md)
- [canDeleteRecord(forManagedObjectWith:)](coredata/nspersistentcloudkitcontainer/candeleterecord(formanagedobjectwith:).md)
- [canModifyManagedObjects(in:)](coredata/nspersistentcloudkitcontainer/canmodifymanagedobjects(in:).md)

### Sharing Objects

- [Accepting Share Invitations in a SwiftUI App](coredata/accepting-share-invitations-in-a-swiftui-app.md)

### Promoting Your Schema

- [initializeCloudKitSchema(options:)](coredata/nspersistentcloudkitcontainer/initializecloudkitschema(options:).md)
- [NSPersistentCloudKitContainerSchemaInitializationOptions](coredata/nspersistentcloudkitcontainerschemainitializationoptions.md)

### Monitoring Container Events

- [NSPersistentCloudKitContainer.Event](coredata/nspersistentcloudkitcontainer/event.md)
- [NSPersistentCloudKitContainer.EventType](coredata/nspersistentcloudkitcontainer/eventtype.md)
- [NSPersistentCloudKitContainerEventRequest](coredata/nspersistentcloudkitcontainereventrequest.md)
- [NSPersistentCloudKitContainerEventResult](coredata/nspersistentcloudkitcontainereventresult.md)
- [eventChangedNotification](coredata/nspersistentcloudkitcontainer/eventchangednotification.md)
- [eventNotificationUserInfoKey](coredata/nspersistentcloudkitcontainer/eventnotificationuserinfokey.md)

### Structures

- [NSPersistentCloudKitContainer.EventChangedMessage](coredata/nspersistentcloudkitcontainer/eventchangedmessage.md)

## Relationships

### Inherits From

- [NSPersistentContainer](coredata/nspersistentcontainer.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### CloudKit mirroring

- [Mirroring a Core Data store with CloudKit](coredata/mirroring-a-core-data-store-with-cloudkit.md)
- [Synchronizing a local store to the cloud](coredata/synchronizing-a-local-store-to-the-cloud.md)
- [NSPersistentCloudKitContainerOptions](coredata/nspersistentcloudkitcontaineroptions.md)
- [Sharing Core Data objects between iCloud users](coredata/sharing-core-data-objects-between-icloud-users.md)
