If locationServicesEnabled return false, I\'m prompting the user to enable their Location Services. The following URL works for 10.0+, redirecting the user to the Settings a
Use this-
UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!)
Using App-prefs may lead to the rejection of the app on app store.
Or you can try this also-
if let bundleId = Bundle.main.bundleIdentifier,
let url = URL(string: "\(UIApplication.openSettingsURLString)&path=LOCATION/\(bundleId)") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}