I want to open location service screen programmatically to turn on service.
You can control what location information your phone can use. Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.
You can turn Location Services on or off at Settings > Privacy > Location Services. You can turn Location Services on either during the Setup Assistant process or later through the Location Services setting. You can individually control which apps and system services have access to Location Services data.
Go to Settings > Privacy, then select Location Services. Select an app, then turn Precise Location on or off.
I have tried all the above answers,it's not working on iOS11..it just opens settings page and not the app settings .. Finally this works..
UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!)
Swift 4.2:
UIApplication.shared.open(URL(string:UIApplication.openSettingsURLString)!)
Refer: https://developer.apple.com/documentation/uikit/uiapplicationopensettingsurlstring?language=swift
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With