Protocol

CBCentralManagerDelegate

The CBCentralManagerDelegate protocol defines the methods that a delegate of a CBCentralManager object must adopt. The optional methods of the protocol allow the delegate to monitor the discovery, connectivity, and retrieval of peripheral devices. The only required method of the protocol indicates the availability of the central manager, and is called when the central manager’s state is updated.

Symbols

Monitoring Connections with Peripherals

func centralManager(CBCentralManager, didConnect: CBPeripheral)

Invoked when a connection is successfully created with a peripheral.

func centralManager(CBCentralManager, didDisconnectPeripheral: CBPeripheral, error: Error?)

Invoked when an existing connection with a peripheral is torn down.

func centralManager(CBCentralManager, didFailToConnect: CBPeripheral, error: Error?)

Invoked when the central manager fails to create a connection with a peripheral.

Discovering and Retrieving Peripherals

func centralManager(CBCentralManager, didRetrieveConnectedPeripherals: [CBPeripheral])

Invoked when the central manager retrieves a list of peripherals currently connected to the system.

func centralManager(CBCentralManager, didRetrievePeripherals: [CBPeripheral])

Invoked when the central manager retrieves a list of known peripherals.

Monitoring Changes to the Central Manager’s State

func centralManagerDidUpdateState(CBCentralManager)
Required.

Invoked when the central manager’s state is updated.

func centralManager(CBCentralManager, willRestoreState: [String : Any])

Invoked when the central manager is about to be restored by the system.

Constants

Advertisement Data Retrieval Keys

Keys to specify in an advertisementData dictionary.

Relationships

Inherits From