有時候咱們須要跳轉到藍牙設置頁面,並且跟隨系統的變化而變化,須要加版本判斷,下面是用到的方法 ide
if (@available(iOS 11.0, *)) url
{spa
NSURL *url= [NSURL URLWithString:@"App-Prefs:root=General&path=Bluetooth"];orm
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];it
}else{io
NSURL *url = [NSURL URLWithString:@"App-Prefs:root=Bluetooth"];class
if ([[UIApplication sharedApplication]canOpenURL:url]) {方法
[[UIApplication sharedApplication]openURL:url];tab
}di
}