title: How can I use a singleton model to manage CoreBluetooth?
body: <p>Okay, I have been checking out the singleton model for the past couple of days and I find that the singleton model is exactly what I need to implement to manage bluetooth for my current app.
  I put in the central manager and peripheral functions from the CoreBluetooth API in the singleton that I defined. When I tried to call the function from my viewController, I kept getting multiple errors like &quot;Cannot invoke central manager with an argument list of type ((CBCentralManager, didDiscoverPeripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber).Type)</p>
  <pre><code>BlueCoreManager.shared.centralManager(CBCentralManager, didDiscoverPeripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber)
  </code></pre>
  <p>This was just one of the many errors I got. BlueCoreManager is my singleton in the above line.</p>
  <p>So I did some more digging and found some outdated source code on github that used the singleton model for bluetooth management. What I saw was a singleton was defined for each function (Select Peripheral, Connect Peripheral, Read Peripheral etc) with a protocol defined for each one. Is this the best practice? I also need to write specific commands to multiple peripherals. Also, in the source code, I noticed that the coreBluetooth api functions were defined in the singleton but were never called directly. Will the functions be called automatically if I refer to the other functions in the singleton? Could someone shed some light on the best way to proceed?</p>