---
title: "getDeviceState(_:)"
framework: coretelephony
role: symbol
role_heading: Instance Method
path: "coretelephony/ctquickswitchmanager/getdevicestate(_:)"
---

# getDeviceState(_:)

Gets the quick switch state of the current device.

## Declaration

```swift
func getDeviceState(_ completionHandler: @escaping @Sendable (CTQuickSwitchState, (any Error)?) -> Void)
```

```swift
var deviceState: CTQuickSwitchState { get async throws }
```

## Parameters

- `completionHandler`: A completion handler the framework calls after processing the request. The parameters passed to the completion handler indicate the doc://com.apple.coretelephony/documentation/CoreTelephony/CTQuickSwitchState and an error value that indicates whether the request succeeded, failed, or ended in an unknown state.

## See Also

### Checking the state of a device

- [getPhoneNumberState(forSuffix:completion:)](coretelephony/ctquickswitchmanager/getphonenumberstate(forsuffix:completion:).md)
- [CTQuickSwitchState](coretelephony/ctquickswitchstate.md)
