0
func centralManagerDidUpdateState(central: CBCentralManager) {
    switch (central.state)
    {
    case .PoweredOff:
        print("off")
    case .PoweredOn:
        centralManager.scanForPeripheralsWithServices(nil, options: nil)
    case .Resetting:
        print("resetting")
    case .Unauthorized:
        print("unaithorized")
    case .Unsupported:
        print("unsupported")
    case .Unknown:
        print("unknown")
    }
}

this code only check the status of bluetooth it can not turn on i want to turn on bluetooth at any way

Paulw11
  • 108,386
  • 14
  • 159
  • 186
kapil
  • 5
  • 4
  • You can't turn bluetooth on programatically if the user denied your application permissions. – mag_zbc Jul 02 '19 at 06:51
  • See https://stackoverflow.com/questions/55212803/how-to-show-an-alert-when-turn-off-bluetooth-in-swift-app/55213031#55213031 – Paulw11 Jul 02 '19 at 06:51

0 Answers0