Guest User

Untitled

a guest
Jun 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var peripherals = [CBPeripheral]()
  2.  
  3. if let current = connectedPeripheral {
  4. disconnectPeripheral(current)
  5. }
  6. if index < peripherals.count {
  7. connectPeripheral(peripherals[index])
  8. stopScan()
  9. }
  10.  
  11. }
  12.  
  13. guard let name = peripheral.name?.lowercased() else {
  14. return
  15. }
  16. guard (name.contains(NamesManager.shared.scanName)) else {
  17. return
  18. }
  19.  
  20.  
  21. if !peripherals.contains(peripheral) {
  22. peripherals.append(peripheral)
  23.  
  24. delegate?.peripheralDidDiscovered()
  25. }
  26. }
Add Comment
Please, Sign In to add comment