<!--
{
  "availability" : [
    "iOS: 8.0.0 - 11.0.0",
    "iPadOS: 8.0.0 - 11.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.10.0 - 10.13.0",
    "tvOS: 9.0.0 - 11.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 4.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKOperation/container",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKOperation(py)container"
  },
  "title" : "container"
}
-->

# container

The operation’s container.

```
var container: CKContainer? { get set }
```

## Discussion

The container defines where the operation executes. The [`add(_:)`](/documentation/CloudKit/CKContainer/add(_:)) method of the [`CKContainer`](/documentation/CloudKit/CKContainer) and [`CKDatabase`](/documentation/CloudKit/CKDatabase) classes implicitly set this property to their container.

If you execute the operation yourself, either directly or using a custom operation queue, set the value of this property explicitly. If the value is `nil` when you execute an operation, the operation implicitly executes in your app’s default container.

---

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)