---
title: "setName(_:forPeripheral:)"
framework: Playground Bluetooth
role: symbol
role_heading: Instance Method
platforms: [xcode 10.2+, swift playgrounds 2.0+]
path: playgroundbluetooth/playgroundbluetoothconnectionview/3029518-setname
---

# setName(_:forPeripheral:)

Displays the name of the specified peripheral.

## Declaration

```swift
func setName(_ name: String, forPeripheral peripheral: CBPeripheral)
```

## Parameters

- `name`: The user-facing name of the specified peripheral.
- `peripheral`: The peripheral corresponding to the name.

## See Also

### Displaying Individual Details

- [setBatteryLevel(_:forPeripheral:)](playgroundbluetooth/playgroundbluetoothconnectionview/3029513-setbatterylevel.md)
- [setFirmwareStatus(_:forPeripheral:)](playgroundbluetooth/playgroundbluetoothconnectionview/3029514-setfirmwarestatus.md)
- [setIcon(_:forPeripheral:)](playgroundbluetooth/playgroundbluetoothconnectionview/3029515-seticon.md)
- [setIssueIcon(_:forPeripheral:)](playgroundbluetooth/playgroundbluetoothconnectionview/3029516-setissueicon.md)
