简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM