CoreBluetooth has refactored both their CBCentralManager and CBPeripheralManager to inherit from CBManager.In this new class, the CBManagerState enumeration exists. This is kind of a big change.What is the best strategy for supporting both CBManagerState along side with CBCentralManagerState and CBPeripheralManagerState enums?This code begins to look quite messy. I don't know of a way to check enum availability, so I check the class that this new property is used in instead.- (void)centralManagerDidUpdateState:(CBCentralManager *)central { if ([CBManager class]) { self.updatedStateBlock((CBManagerState)central.state); } else { self.updatedStateBlock((CBCentralManagerState)central.state); } }Previously my updatedStateBlock was defined as such, but now the named ns_enumeration has changed its name.@property (nonatomic, copy) void (^updatedStateBlock)(CBCentralManagerState state);I could possibly refactor my framework API to pass the manager instead, and then the caller would have to query the state pro
3
0
4.3k