Swift 4.2, iOS 12
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: UIApplication.openSettingsURLString),
UIApplication.shared.canOpenURL(settingsURL)
else {
return false
}
UIApplication.shared.open(settingsURL)
return true
}
}
Usage: UIApplication.openAppSetting()
I also used non-public URL scheme, such as: prefs:root=
, but my app was rejected. So if you're trying to do more specific stuff with deeplinking, don't waste your time because at the moment you can't!