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

# connectionView(_:itemForPeripheral:withAdvertisementData:)

Tells the delegate that a new peripheral was discovered and can be displayed in the connection view.

## Declaration

```swift
func connectionView(_ connectionView: PlaygroundBluetoothConnectionView, itemForPeripheral peripheral: CBPeripheral, withAdvertisementData advertisementData: [String : Any]?) -> PlaygroundBluetoothConnectionView.Item
```

## Parameters

- `connectionView`: The connection view showing available peripherals.
- `peripheral`: The peripheral to display in the connection view.
- `advertisementData`: The advertisement data you use to help decide how to display the peripheral.

## Return Value

Return Value A PlaygroundBluetoothConnectionView.Item instance that's displayed within a PlaygroundBluetoothConnectionView.
