---
title: "accountStatus(completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckcontainer/accountstatus(completionhandler:)"
---

# accountStatus(completionHandler:)

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

## Declaration

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

```swift
func accountStatus() async throws -> CKAccountStatus
```

## Parameters

- `completionHandler`: The handler to execute when the call completes.

## Discussion

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 CKAccountChanged notification to detect account changes, and call this method again to determine the status of the new account.

## See Also

### Determining the User’s iCloud Access Status

- [CKAccountStatus](cloudkit/ckaccountstatus.md)
