Instance Method

centralManager(_:didConnect:)

Tells the delegate that the central manager connected to a peripheral.

Declaration

optional func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral)

Parameters

central

The central manager that provides this information.

peripheral

The now-connected peripheral.

Discussion

The manager invokes this method when a call to connect(_:options:) succeeds. You typically implement this method to set the peripheral’s delegate and discover its services.

See Also

Monitoring Connections with Peripherals

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

Tells the delegate that the central manager disconnected from a peripheral.

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

Tells the delegate the central manager failed to create a connection with a peripheral.

func centralManager(CBCentralManager, connectionEventDidOccur: CBConnectionEvent, for: CBPeripheral)

Tells the delegate that a connection event occurred which matches the registered options.