iPhone - how to put Settings bundle seen through System Settings App into your own App?

StackOverflow https://stackoverflow.com/questions/839242

  •  22-07-2019
  •  | 
  •  

Question

I want to create a settings page from within my app that looks exactly like the one that I would create in the System Settings Application using a Settings.bundle and Root.plist.

Is there an easy way to access the controls like PSMultiValueSpecifier etc. and add them to an actual View?

Thanks!

Was it helpful?

Solution

Yet another options:

OTHER TIPS

Here's another solution:

  • http://www.inappsettingskit.com/

    InAppSettingsKit is an open source solution to to easily add in-app settings to your iPhone apps. It uses a hybrid approach by maintaining the Settings.app pane. So the user has the choice where to change the settings...

    To support traditional Settings.app panes, the app must include a Settings.bundle with at least a Root.plist to specify the connection of settings UI elements with NSUserDefaults keys. InAppSettingsKit basically just uses the same Settings.bundle to do its work. This means there's no additional work when you want to include a new settings parameter. It just has to be added to the Settings.bundle and it will appear both in-app and in Settings.app. All settings types like text fields, sliders, toggle elements, child views etc. are supported...

The topic on whether settings should go in your app or in the preference app is controversial, mainly because there's no way to open the settings from the app (as noted in the answer coob links to) and because there's no way to add interaction to settings -- and there's many reasons you may want to, including validity/consistency/network checks, etc.

So should you want to present a UI that's somewhat like the settings UI in your app, I don't know of any easy or ready made code to do it, but Matt Gallagher's code is a great start to roll your own.

Craig Hockenberry has a project called GenericTableViews that helps you easily make a table view for settings or forms.

And another (separate post due to 'newbie spam protection' sorry).

They use the "standard" Settings.bundle approach -- but are fairly easy to present in-app. And you also get the system 'Settings' behaviour for free.

On iOS 8 and later, if you already have a settings bundle, it's dead easy to launch from your app into the Settings app to manage it: (Swift 3 example)

if let settingsURL = URL(string: UIApplicationOpenSettingsURLString) {
            UIApplication.shared.open(settingsURL)
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top