---
title: "connectionView(_:titleFor:)"
framework: Playground Bluetooth
role: symbol
role_heading: Instance Method
platforms: [xcode 10.2+, swift playgrounds 2.0+]
path: playgroundbluetooth/playgroundbluetoothconnectionviewdelegate/3029527-connectionview
---

# connectionView(_:titleFor:)

Tells the delegate that the connection view needs a title to display for its current state.

## Declaration

```swift
func connectionView(_ connectionView: PlaygroundBluetoothConnectionView, titleFor state: PlaygroundBluetoothConnectionView.State) -> String
```

## Parameters

- `connectionView`: The connection view that’s entering this state.
- `state`: The state of the view. The state is one of the cases of the doc://com.apple.documentation/documentation/playgroundbluetooth/playgroundbluetoothconnectionview/state enumeration.

## Return Value

Return Value A localized string corresponding to the current state of the view.

## See Also

### Displaying New Peripherals

- [connectionView(_:shouldConnectTo:withAdvertisementData:)](playgroundbluetooth/playgroundbluetoothconnectionviewdelegate/3029523-connectionview.md)
- [connectionView(_:shouldDisplayDiscovered:withAdvertisementData:rssi:)](playgroundbluetooth/playgroundbluetoothconnectionviewdelegate/3029525-connectionview.md)
