Put your BLE related code in a centralized place, for example. BLEMaganer (better) or AppDelegate (so on). In this way, controller and controller B can share the same instance of centrolManager.
For example, you currently have the centralManager property in controller A and implements its delegate in controller A. You access centralManager using controllerA.centralManager .
Move the centralManager property to AppDelegate , as well as other related code. Then you can access the centrolManager instance with
(UIApplication.sharedApplication().delegate as! AppDelegate).centralManager.
dichen
source share