---
title: PlaygroundBluetoothConnectionView.State
framework: Playground Bluetooth
role: symbol
role_heading: Enumeration
platforms: [xcode 10.2+, swift playgrounds 2.0+]
path: playgroundbluetooth/playgroundbluetoothconnectionview/state
---

# PlaygroundBluetoothConnectionView.State

The states that tell users how to proceed when connecting to and switching between peripherals in a playground page.

## Declaration

```swift
enum PlaygroundBluetoothConnectionView.State
```

## Overview

Overview The example below shows how to use the different states as part of adopting the PlaygroundBluetoothConnectionViewDelegate protocol. extension PageViewDelegate: PlaygroundBluetoothConnectionViewDelegate {     func connectionView(_ connectionView: PlaygroundBluetoothConnectionView, titleFor state: PlaygroundBluetoothConnectionView.State) -> String {         // Pick a name that matches the types of peripheral your playground         // supports, such as "Robot", "Speaker", or "Light".         let name = "Peripheral"         switch state {         case .noConnection:             return "Connect \(name)"         case .connecting:             return "Connecting \(name)"         case .searchingForPeripherals:             return "Searching for \(name)s"         case .selectingPeripherals:             return "Select a \(name)"         case .connectedPeripheralFirmwareOutOfDate:             return "Connect to a Different \(name)"         }     } }

## Topics

### Waiting for Connections

- [PlaygroundBluetoothConnectionView.State.connecting](playgroundbluetooth/playgroundbluetoothconnectionview/state/connecting.md)
- [PlaygroundBluetoothConnectionView.State.noConnection](playgroundbluetooth/playgroundbluetoothconnectionview/state/noconnection.md)
- [PlaygroundBluetoothConnectionView.State.searchingForPeripherals](playgroundbluetooth/playgroundbluetoothconnectionview/state/searchingforperipherals.md)

### Selecting Connections

- [PlaygroundBluetoothConnectionView.State.selectingPeripherals](playgroundbluetooth/playgroundbluetoothconnectionview/state/selectingperipherals.md)

### Handling Old Firmware

- [PlaygroundBluetoothConnectionView.State.connectedPeripheralFirmwareOutOfDate](playgroundbluetooth/playgroundbluetoothconnectionview/state/connectedperipheralfirmwareoutofdate.md)

### Comparing Connection States

- [!=(_:_:)](playgroundbluetooth/playgroundbluetoothconnectionview/state/3029501.md)

## See Also

### Handling State Changes

- [delegate](playgroundbluetooth/playgroundbluetoothconnectionview/3029510-delegate.md)
