Instance Method

peripheral(_:didDiscoverServices:)

Invoked when you discover the peripheral’s available services.

Declaration

optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?)

Parameters

peripheral

The peripheral that the services belong to.

error

If an error occurred, the cause of the failure.

Discussion

This method is invoked when your app calls the discoverServices(_:) method. If the services of the peripheral are successfully discovered, you can access them through the peripheral’s services property. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

See Also

Discovering Services

func peripheral(CBPeripheral, didDiscoverIncludedServicesFor: CBService, error: Error?)

Invoked when you discover the included services of a specified service.

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