<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKContainer/accountStatus(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKContainer(im)accountStatusWithCompletionHandler:"
  },
  "title" : "accountStatus(completionHandler:)"
}
-->

# accountStatus(completionHandler:)

Determines whether the system can access the user’s iCloud account.

```
func accountStatus(completionHandler: @escaping @Sendable (CKAccountStatus, (any Error)?) -> Void)
```

## Parameters

`completionHandler`

The handler to execute when the call completes.

## Discussion

The closure has no return value and takes the following parameters:

- The status of the user’s iCloud account.
- An error that describes the failure, or `nil` if the system successfully determines the status.

This method determines the status of the user’s iCloud account asynchronously, passing the results to the closure that you provide. Call this method before accessing the private database to determine whether that database is available. While your app is running, use the <doc://com.apple.documentation/documentation/Foundation/NSNotification/Name-swift.struct/CKAccountChanged> notification to detect account changes, and call this method again to determine the status of the new account.

---

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)