Swift showBluetoothAccessoryPicker不';t显示在屏幕上
我的代码 调试控制台Swift showBluetoothAccessoryPicker不';t显示在屏幕上,swift,bluetooth,Swift,Bluetooth,我的代码 调试控制台 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. view.backgroundColor = .white view.addSubview(connectBtn) connectBtn.centerYAnchor.constraint(equalTo: view.centerYAnc
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = .white
view.addSubview(connectBtn)
connectBtn.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
connectBtn.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
connectBtn.heightAnchor.constraint(equalToConstant: 30).isActive = true
connectBtn.widthAnchor.constraint(equalToConstant: 100).isActive = true
connectBtn.addTarget(self, action: #selector(showAccessoryPicker), for: .touchUpInside)
}
@objc func showAccessoryPicker() {
EAAccessoryManager.shared().showBluetoothAccessoryPicker(withNameFilter: nil, completion: nil)
}
我使用官方SDK连接,工作正常
2020-07-21 15:26:40.674865+0800 StarPrnt[22299:6727201] A constraint factory method was
passed a nil layout anchor. This is not allowed, and may cause confusing exceptions. Break
on BOOL _NSLayoutConstraintToNilAnchor(void) to debug. This will be logged only once. This
may break in the future.