Is it possible to directly open the Settings app from the widget/today extension?
I have tried the following code, but sadly it is not working
let url = URL(string:UIApplicationOpenSettingsURLString)!
extensionContext?.open(url) { _ in }
this code should be work
guard let url = URL(string: UIApplicationOpenSettingsURLString) else {
return
}
extensionContext?.open(url, completionHandler: { (success) in
if !success {
var responder = self as UIResponder?
while (responder != nil){
let selectorOpenURL = NSSelectorFromString("openURL:")
if responder?.responds(to: selectorOpenURL) == true {
_ = responder?.perform(selectorOpenURL, with: url)
}
responder = responder?.next
}
}
})