Created
May 27, 2019 03:06
-
-
Save kitchen/6706fe58e02e601a339d582552de67d2 to your computer and use it in GitHub Desktop.
step 1, power on!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initializing TNC3Connector | |
initializing CBCentralManager | |
CBCentralManager started |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreBluetooth | |
import PlaygroundSupport | |
class TNC3Connector: NSObject { | |
var centralManager: CBCentralManager! | |
override init() { | |
super.init() | |
print("initializing CBCentralManager") | |
centralManager = CBCentralManager(delegate: self, queue: nil) | |
} | |
} | |
extension TNC3Connector: CBCentralManagerDelegate { | |
func centralManagerDidUpdateState(_ central: CBCentralManager) { | |
print("CBCentralManager started") | |
} | |
} | |
// instantiate our class | |
print("initializing TNC3Connector") | |
var connector = TNC3Connector() | |
// run forever | |
PlaygroundPage.current.needsIndefiniteExecution = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment