---
title: PlaygroundBluetoothConnectionViewDataSource
framework: Playground Bluetooth
role: symbol
role_heading: Protocol
platforms: [xcode 10.2+, swift playgrounds 2.0+]
path: playgroundbluetooth/playgroundbluetoothconnectionviewdatasource
---

# PlaygroundBluetoothConnectionViewDataSource

The protocol you adopt to display an available peripheral in a playground page’s connection view.

## Declaration

```swift
protocol PlaygroundBluetoothConnectionViewDataSource : AnyObject
```

## Overview

Overview The example below shows a conformance to this protocol that uses images from a playground book’s Public and Private Resources Folders. extension PageViewDelegate: PlaygroundBluetoothConnectionViewDataSource {     func connectionView(_ connectionView: PlaygroundBluetoothConnectionView, itemForPeripheral peripheral: CBPeripheral, withAdvertisementData advertisementData: [String: Any]?) -> PlaygroundBluetoothConnectionView.Item {         let icon = UIImage(named: "Peripheral_Icon_Normal")!         let issueIcon = UIImage(named: "Peripheral_Icon_Issue")!         let name = peripheral.name ?? peripheral.identifier.uuidString                  return .init(name: name, icon: icon, issueIcon: issueIcon)     } } Some peripherals have Bluetooth characteristics that provide information about the peripheral’s battery charge level or firmware status. Include this information in the PlaygroundBluetoothConnectionView.Item you create when it will help people pick a peripheral.

## Topics

### Displaying Connection View Items

- [connectionView(_:itemForPeripheral:withAdvertisementData:)](playgroundbluetooth/playgroundbluetoothconnectionviewdatasource/3029520-connectionview.md)

## See Also

### Peripheral Display

- [PlaygroundBluetoothConnectionView](playgroundbluetooth/playgroundbluetoothconnectionview.md)
- [PlaygroundBluetoothConnectionViewDelegate](playgroundbluetooth/playgroundbluetoothconnectionviewdelegate.md)
