0
最近Xcode 8.0をダウンロードし、コアbluetoothを使用している以前のプロジェクトを実行しようとしました。Xcode 8.0 CBCentralManager問題
func centralManagerDidUpdateState(central: CBCentralManager)
{
print("state is \(central.state.rawValue)")
if (central.state == CBCentralManagerState.PoweredOn)
{
self.centralManager?.scanForPeripheralsWithServices([serviceUUID], options: nil)
}
else
{
// do something like alert the user that ble is not on
}
}
以前
central.stateが
CBCentralManagerState型を返すだろう、私は すべての作品SWIFT 2.3で互換性のためにビルド設定に
使用レガシー・スウィフト言語バージョンを有効にしているが、一つの問題が発生しましたintとして、今すぐ返す
CBManagerState私は
に変更しました。
CBManagerStateはIOS 10+でのみサポートされていますが、IOS 8.3+用にビルドしたいのですが、どのようにコードを変更できますか?
UPDATE 私も迅速3.0に変換したプロジェクトが、それでも同じ問題なので、私は10以下のiOS版と携帯電話でこのプロジェクトを実行することができますか?