iOS Application Settings Bundle - ios

Using Apple's Settings bundle in a project, is it possible to expose certain settings to the user only if another setting condition is met?
E.g I have a toggle switch, and if the user toggles the selection to False in the Settings application, I want to show a text box that they can fill in. If the toggle is true, I want to hide the text box.
Any help or pointers to documentation that explain this would be great.

You can find step by step instructions here: Adding a settings bundle to an iPhone App.
Edit:
I did my research and I think you cannot do this in an App Store approved app, because to reach this thing you have to change the settings.bundle file inside the application's bundle, which is not allowed in App Store approved apps.

Related

In-app preferences screen in an iOS 7 app

I'm fairly new to iOS development and I am porting an Android app to iOS 7. The Android app provides a screen that allows the user to change a number of non persistent settings. Because these are not saved, it doesn't seem appropriate to me to expose them, on iOS, as preferences via a settings bundle and the built-in Settings app. So I'm looking at an in-app settings screen, which I understand is allowed - but perhaps not encouraged - by Apple.
Some questions:
Am I correct that an in-App approach is allowed by Apple? Most example code seems to use settings bundles. Am I going to have problems when the app is submitted to the App Store?
I can put the settings UI in a simple UITableViewController, but is there an approved way to expose this to the user? XCode 5 doesn't provide a settings identifier (and icon) for toolbar buttons, and the "Info" identifier (letter i inside a circle) seems to have been dropped too. Should I use a custom icon? Are there any de facto standards?
I haven't seen this kind of UI element before on iOS but my exposure to the platform as a user is limited.
There is nothing wrong with doing an in-app preference (table)view. You won't be rejected for that (this point seems to be way too much exagerated outside the iOS community). There are guidelines that you can follow: iOS Human Interface Guidelines... or not. As long as you don't use private APIs (assuming you know how to access them anyway), you're fine! So you can use a custom icon, the "i" button, or any UI element that convey the reasonable meaning of providing access to more info/preference.
In your code, you can use the class NSUserDefaults (with the standardUserDefaults) to store your preferences.
Many apps have in-app settings. It's fine. Apple even states that it is fine. Just don't have both.
Use a custom icon. Many apps seem to use an icon that looks like a gear.

Open iPhone/iPad settings from my app

In my app I have some settings that are accessible within the Setting native app... a normal Settings.bundle file.
The question is "is possible from my application open Settings app to the settings page of my app to facilitate the user experience?"
Thanks.
I didn't realise this wasn't possible as the other answers/comments indicate. But I've been using InAppSettingsKit to mimic that behaviour anyway.
It reads from your Settings.bundle and creates a view controller based on the information.

How do I add a plist file to Setting.bundle programmatically?

I am trying to add a plist file to the Settings.bundle in my iOS project programmatically. How would I go about doing this?
I used Apple's API to find where to put a created plist file to see if the Settings.bundle would check there for a plist file but it doesn't recognize it and the child pane goes to a blank screen instead of showing the settings.
The reason for this is based on the user logging in to my app I want to have different settings show in the Settings App
You don't. Settings.bundle is supposed to be created at compile time, and is fixed (as well as signed as part of the application build process.)
See the Settings.bundle documentation which explicitly states (emphasis added):
A Settings bundle has the name Settings.bundle and resides in the top-level directory of your app’s bundle.
The emphasized part is what tells me you can't put the bundle anywhere else. This answer confirms what I just said.
Conditionally displayed settings are also not possible.
I don't think you can. The OS handles that independently, and you aren't allowed to run any code to affect it.
Instead, you are going to want to offer a settings screen within your app that allows full control over the presentation and function.

In-App Settings or Settings Bundle

What's the better approach, use In-App Settings (A Screen on Startup) or use the Settings Bundle and if nothing is entered show a popup on start? Or is it possible to combine both?
BR,
mybecks
Apple says:
Which option you choose depends on how you expect users to interact with preferences. The Settings bundle is generally the preferred mechanism for displaying preferences. However, games and other apps that contain configuration options or other frequently accessed preferences might want to present them inside the app instead.
Therefore if the settings are going to be used frequently use in-app settings, otherwise make a settings bundle
Try InAppSettingsKit, it will provide you a hybrid solution by maintaining the Settings.app pane.

Display Settings.bundle Root.plist in a view inside the app

I would like to let the user access the settings for the app both from iOS Settings app and from the app itself.
Right now I am using Settings.bundle to access the settings from the Settings app, is there an easy way to implement a controller inside the app to access the same settings?
As a side question, is there an easy way to implement a settings-like view starting from a plist?
There are a few Open Source projects to do just this. About a year ago I evaluated all the ones I could find and ended up using InAppSettingsKit. Second place was mySettings, but it looks as though that is no longer being maintained.

Resources