My iOS app receives temperature/etc data from another device, a peripheral. I can receive events at any time, but want to be able to navigate to other screens while the temperature samples are being collected and not lose any samples. I don't want to be tied to the view controller that implements CBCentralManagerDelegate
methods. I've broken this out as a singleton class that inherits from NSObject
, MyDevice
.
I'm trying to figure out how to manage all the events coming in and have new screens be able to subscribe and unsubscribe from these events all the time as a user moves throughout the app. Does it make sense for this class to keep the overall @property (strong, nonatomic) CBCentralManager *
and implement CBCentralManagerDelegate
? How is this commonly managed?
Aucun commentaire:
Enregistrer un commentaire