hydro
hydro

Reputation: 31

Xcode IOS 8.3 swift how to check if bluetooth is connected?

Does anyone know a way to just check if Bluetooth is connected for iOS? I'm just looking to check for connection, and not trying to connect.

Upvotes: 3

Views: 3452

Answers (1)

vcsjones
vcsjones

Reputation: 141588

You would probably use CBCentralManager for that. You can use retrieveConnectedPeripheralsWithServices to get a list of things that are connected based on their service UUID. If all you want to know is if Bluetooth is on or off, examine the state property of a CBCentralManager instance to determine if it is powered on or off.

Upvotes: 3

Related Questions