I have the following code:
import CoreBluetooth class BrowserSample: NSObject, CBCentralManagerDelegate { let central : CBCentralManager init() { central = CBCentralManager(delegate: self, queue: nil, options: nil) super.init() } func centralManagerDidUpdateState(central: CBCentralManager!) { } }
If I put the central = line before super.init() , then I get an error:
self used before super.init() call
If I put it after, I get an error message:
Property self.central not initialized at super.init call
So, I'm confused. How to do it?
ios swift core-bluetooth
Ana
source share