Framework

PlaygroundBluetooth

Display and manage connections to Bluetooth peripherals in Swift Playgrounds.

Overview

The PlaygroundBluetooth framework provides a common interface that you use to display and manage connections to Bluetooth peripherals from the framework’s central manager within a playground page.

Figure 1

A playground page’s connection view provided by the PlaygroundBluetooth framework.

A screenshot showing a PlaygroundBluetoothConnectionView instance in the upper right corner. The connection view is displaying three peripherals; one is marked as connected.

Topics

Peripheral Connection

Connecting to Bluetooth Peripherals in Swift Playgrounds

Scan for peripherals and display them in your playground's live view.

class PlaygroundBluetoothCentralManager

A streamlined interface for connecting the central manager for the current playground page to nearby Bluetooth peripherals.

protocol PlaygroundBluetoothCentralManagerDelegate

A delegate you use to respond to peripheral discovery and manage the lifecycle of connections.

Peripheral Display

class PlaygroundBluetoothConnectionView

A view that displays the connection status of a peripheral to the central manager for the current page and manages connections to other peripherals.

protocol PlaygroundBluetoothConnectionViewDelegate

A delegate you use to respond to user- and system-initiated interactions with the central manager’s connection view.

protocol PlaygroundBluetoothConnectionViewDataSource

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