How to open Location services screen from setting screen?

Monika Patel picture Monika Patel · Jun 6, 2016 · Viewed 47.8k times · Source

I want to open location service screen programmatically to turn on service.

enter image description here

Answer

Vijay Karthik picture Vijay Karthik · May 22, 2018

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