JayVDiyk JayVDiyk - 3 months ago 38
Objective-C Question

Open Settings iOS 8 URL

How do we open Settings using the UIApplication.sharedApplication()

What URL should I pass in?

I used the

UIApplicationOpenSettingsURLString
but it opens directly to the Application specific Settings page. but I would like to have it open the first level of the Settings app.

Or even better, I would like it to open directly to the page where user can enable the Location Services on their phone.

the codes below opens directly to the Application specific Settings page.

UIApplication.sharedApplication().openURL(NSURL(string: UIApplicationOpenSettingsURLString)!);

Answer

the answer to this questions is NO, we can't open direct Location page ,but we can open UIApplicationOpenSettingsURLString (settings page)

try this

if let appSettings = NSURL(string: UIApplicationOpenSettingsURLString) {
UIApplication.sharedApplication().openURL(appSettings)
}
else
{
 // your URL is invalid
}

for additional information