Skip to content

Instantly share code, notes, and snippets.

@AminPlusPlus
Created July 9, 2020 02:24
Show Gist options
  • Save AminPlusPlus/ae86d63279afe211739a7cc1ad69e32b to your computer and use it in GitHub Desktop.
Save AminPlusPlus/ae86d63279afe211739a7cc1ad69e32b to your computer and use it in GitHub Desktop.
PeripheralDiscoverCharac
//MARK:- CBPeripheralDelegate
extension ViewController : CBPeripheralDelegate {
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
if let services = peripheral.services {
//discover characteristics of services
for service in services {
peripheral.discoverCharacteristics(nil, for: service)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment