我想從我的iOS應用程序中打開WIFI設置部分,我的代碼是與iOS 9.2如何斯威夫特打開WIFI設置3
if let settingsURL = URL(string: AppSettingsWifiUrl) {
UIApplication.shared.openURL(settingsURL)
}
斯威夫特3之前運作良好,但在更新之後不能在Xcode工作8 + Swift 3 + iOS 10,有人可以幫忙嗎?
我想從我的iOS應用程序中打開WIFI設置部分,我的代碼是與iOS 9.2如何斯威夫特打開WIFI設置3
if let settingsURL = URL(string: AppSettingsWifiUrl) {
UIApplication.shared.openURL(settingsURL)
}
斯威夫特3之前運作良好,但在更新之後不能在Xcode工作8 + Swift 3 + iOS 10,有人可以幫忙嗎?
使用iOS的10以下和以上:
if let url = URL(string:"App-Prefs:root=Settings&path=General") {
UIApplication.shared.openURL(url)
}
你從哪裏得到這些信息? – winklerrr
這件事將與iOS 10也行,但你必須在UR項目設置信息添加URL類型。 URL方案應該是pref 如果您需要我將分享屏幕截圖,以便您可以輕鬆實現。
感謝
let url=URL(string: "App-Prefs:root=Privacy&path=Location")
if UIApplication.shared.canOpenURL(url!)
{
UIApplication.shared.open(url!, options: [:], completionHandler: {sucess in
})
}
else{
UIApplication.shared.open(url!, options: [:], completionHandler: {sucess in
})
}
它可能iOS的10和斯威夫特3
let url = URL(string: "App-Prefs:root=WIFI") //for WIFI setting app
let app = UIApplication.shared
app.openURL(url!)
我們不能再這樣下去了iOS上的11,我們可以打開的設置:
if let url = URL(string:UIApplicationOpenSettingsURLString) {
if UIApplication.shared.canOpenURL(url) {
let url = UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
http://stackoverflow.com/questions/281525 26 /如何打開手機設置 - 當按鈕被點擊時 - ios –
@SinaKH:感謝您的回覆,但它會打開應用程序設置我想打開WIFI設置。 – RJ168