The following code works fine on iOS 9, see this post. But it doesn\'t work on iOS 10. How to open WIFI settings programmatically on iOS 10
[[UIApplication s
Swift 4.2, iOS 12
It's not longer possible to do that kind of deeplinking with the newer version of iOS. My app was recently rejected for using: "non-public URL scheme", such as: prefs:root=. So I'd say to not waste your time with something that we can't currently do, and simply open the settings.
This is the function that I'm currently using in my app for it:
extension UIApplication {
...
@discardableResult
static func openAppSetting() -> Bool {
guard
let settingsURL = URL(string: UIApplicationOpenSettingsURLString),
UIApplication.shared.canOpenURL(settingsURL)
else {
return false
}
UIApplication.shared.open(settingsURL)
return true
}
}
Usage: UIApplication.openAppSetting()