Setup bluetoooth central manager

Other topics

Declare and instantiate CBCentralManager

Swift:

var centralManager:CBCentralManager!

centralManager = CBCentralManager(delegate: self, queue: nil)

Objective C:

@property (nonatomic, strong) CBCentralManager *centralManager;

centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];

Declare and instantiate CBCentralManager with options

Swift:

var centralManager:CBCentralManager!

centralManager = CBCentralManager(delegate: self, queue: nil, options: [CBCentralManagerOptionRestoreIdentifierKey : "com.companyname.appname.central"])

Objective C:

@property (nonatomic, strong) CBCentralManager *centralManager;

self.centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:@{CBCentralManagerOptionRestoreIdentifierKey : @"com.companyname.appname.central"}];

Contributors

Topic Id: 9760

Example Ids: 30076,30077

This site is not affiliated with any of the contributors.