Instance Method

runModal()

Runs the pairing panel in a modal session to allow the user to select a Bluetooth device.

Declaration

func runModal() -> Int32

Return Value

Returns kIOBluetoothUISuccess if a successful, validated device selection was made by the user and that device successfully paired. Returns kIOBluetoothUIUserCanceledErr if the user cancelled the panel. These return values are the same as NSRunStoppedResponse and NSRunAbortedResponse respectively. They are the standard values used in a modal session.

Discussion

The controller will use the panel attributes to filter what devices the user sees. The allowed UUIDs will be used to validate the selection the user makes. Only when a selection has been validated (or the panel cancelled) and the device paired, will this method return.

NOTE: This method is only available in macOS 10.2.4 (Bluetooth v1.1) or later.