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.


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

Monitoring Changes to the Central Manager’s State

func centralManagerDidUpdateState(CBCentralManager)

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.


Advertisement Data Retrieval Keys

Keys to specify in an advertisementData dictionary.


Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software