title: How to List discoverable Bluetooth devices and already paired devices in iOS, which method to use in swift?
body: <p>I would like to include Bluetooth feature on my app using swift. I want to list all nearby/discoverable peripheral devices including those devices are already paired </p>
  
  <p>Which method i should use for listing the paired devices. Im using <strong>CoreBlutooth</strong> framework for implementing Bluetooth availability check. If Bluetooth works fine i would like to list out paired devices. And if possible please provide the method for connecting the device directly from the listed paired devices</p>
  
  <pre><code> func startUpCentralManager() {
      println("Initializing central manager")
      centralManager = CBCentralManager(delegate: self, queue: nil)
  
  
  }
  
  
  
  func centralManagerDidUpdateState(central: CBCentralManager!) {
      println("\(__LINE__) \(__FUNCTION__)")
       println("checking state")
  
      if central.state != .PoweredOn {
          // In a real app, you'd deal with all the states correctly
                      return
      }
      central.scanForPeripheralsWithServices(nil,options:nil)
  
  
  }
  </code></pre>
  
  <p>//this method is not triggering</p>
  
  <pre><code>  func centralManager(central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData: [NSObject : AnyObject]!, RSSI: NSNumber!) {
  
      var localname: NSString = advertisementData[CBAdvertisementDataLocalNameKey]! as NSString
  
      println("Discovered\(peripheral.name)")
  
      if localname != " "
      {
          centralManager!.stopScan()
          //self.peripheral = peripheral
          peripheral.delegate = self
          centralManager!.connectPeripheral(peripheral, options: nil)
  
  
      }
  
  
  }
  </code></pre>
  
  <p>is these methods are necessary to show the near by peripherals if not which methods and codes to be implemented  </p>
  
  <p>Thanks in Advance</p>