【发布时间】:2019-04-29 05:38:37
【问题描述】:
我想使用标识符连接外围设备。 可以吗?
centralManager?.connect(peripheral, options: nil)
我正在扫描一个ViewController 中的设备,并在另一个ViewController 中连接它。
以下是我的要求:
当我扫描设备并保存下次可以出现在主屏幕并直接连接的设备时。
因此,为此,我使用单例类将外围数据从一个视图访问到另一个视图。但它总是初始化为空。
所以我想通过使用标识符来连接外围设备。
我不知道我们将[CBPeripheral] 存储在哪里并在需要时访问它。
【问题讨论】:
标签: ios swift bluetooth-lowenergy core-bluetooth