Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var peripherals = [CBPeripheral]()
- if let current = connectedPeripheral {
- disconnectPeripheral(current)
- }
- if index < peripherals.count {
- connectPeripheral(peripherals[index])
- stopScan()
- }
- }
- guard let name = peripheral.name?.lowercased() else {
- return
- }
- guard (name.contains(NamesManager.shared.scanName)) else {
- return
- }
- if !peripherals.contains(peripheral) {
- peripherals.append(peripheral)
- delegate?.peripheralDidDiscovered()
- }
- }
Add Comment
Please, Sign In to add comment