Accessing the Settings app from your app in iOS 8? Accessing the Settings app from your app in iOS 8? ios ios

Accessing the Settings app from your app in iOS 8?


As of iOS 8, it is possible to take a user from your app directly into the Settings app. They will be deep linked into your app's specific Settings page, but they can back out into the top level Settings screen.

If you're also supporting iOS 7 you'll need to check first if a specific string constant is present.

UPDATE:

If your deployment target is set to 8.0 or above, Xcode 6.3 will give you the following warning:

Comparison of address of 'UIApplicationOpenSettingsURLString' not equal to a null pointer is always true

This is because the feature was available starting in 8.0, so this pointer will never be NULL. If your deployment target is 8.0+, just remove the if statement below.

if (&UIApplicationOpenSettingsURLString != NULL) {    NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];    [[UIApplication sharedApplication] openURL:appSettings];} 


Use UIApplicationOpenSettingsURLString.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];


In Swift:

if let settingsURL = NSURL(string: UIApplicationOpenSettingsURLString) {    UIApplication.sharedApplication().openURL(settingsURL)}