1. 程式人生 > >iOS10App如何跳轉到系統設置<轉>

iOS10App如何跳轉到系統設置<轉>

pap open paper with 點擊 arr border obi nsurl

在最近做的一個Wi-Fi類的項目,需要實現類似萬能鑰匙中點擊一個Wi-Fi跳轉到系統Wi-Fi設置界面的功能。廢話我就不多說了,下面就是實現代碼了。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 NSString * urlString = @"App-Prefs:root=WIFI"; if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlString]]) { if ([[UIDevice currentDevice].systemVersion doubleValue] >= 10.0) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; } }

類似也有跳轉到以下:

無線局域網 App-Prefs:root=WIFI

藍牙 App-Prefs:root=Bluetooth

蜂窩移動網絡 App-Prefs:root=MOBILE_DATA_SETTINGS_ID

個人熱點 App-Prefs:root=INTERNET_TETHERING

運營商 App-Prefs:root=Carrier

通知 App-Prefs:root=NOTIFICATIONS_ID

通用 App-Prefs:root=General

通用-關於本機 App-Prefs:root=General&path=About

通用-鍵盤 App-Prefs:root=General&path=Keyboard

通用-輔助功能 App-Prefs:root=General&path=ACCESSIBILITY

通用-語言與地區 App-Prefs:root=General&path=INTERNATIONAL

通用-還原 App-Prefs:root=Reset

墻紙 App-Prefs:root=Wallpaper

Siri App-Prefs:root=SIRI

隱私 App-Prefs:root=Privacy

Safari App-Prefs:root=SAFARI

音樂 App-Prefs:root=MUSIC

音樂-均衡器 App-Prefs:root=MUSIC&path=com.apple.Music:EQ

照片與相機 App-Prefs:root=Photos

FaceTime App-Prefs:root=FACETIME

只需要把對應的字符串換一下就可以了。

iOS10App如何跳轉到系統設置<轉>