Skip to content

Hejki/ios_open_settings_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here is instructions how to open specific system settings page from your iOS application. It works from iOS version 8. I create small demo project which you can check, it's available on GitHub.

Project setup

  • First set bundle URL type to allow handle prefs URL scheme by your application
  • In XCode open project settings: Targets - ApplicationTarget - Info - URL Types URL Types settings
  • Or add CFBundleURLTypes key to application's info.plist
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>prefs</string>
        </array>
    </dict>
</array>
  • Now you can use UIApplication.sharedApplication().openURL(url) to open desired setting page
let app = UIApplication.sharedApplication()
let url = NSURL(string: "prefs:root=General&path=About")!
 
if app.canOpenURL(url) {
    app.openURL(url)
}
  • For available URLs check Links section below
  • You can use URL string UIApplicationOpenSettingsURLString to open current application settings if application has any

Links

About

Example iOS project for how to open specific setting page in system settings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages