I would like to build a settings interface for the iOS app.
Note – These settings would often change so I prefer a setting interface app instead of the settings bundle
My thoughts
- I liked the modal segue to get to the settings view
- my settings view is going to be a table view
- I prefer if the table view is static (as each cell might lead to a different view)
Problems:
-
In modal view, the navigation bar doesn’t seem to appear. I would need the navigation bar, so that I can create a “Save” button on it ?
-
In order to solve the above mentioned, I created a UIViewController to manage the settings view and added a navigation bar and a table view under the UIViewController’s view (Using a UITableViewController to cause the navigation bar to scroll with the cells)
-
But creating a UIViewController doesn’t allow me to create a table with static content
Questions:
- How can the above mentioned be achieved ?
- Is there a better way to do a settings screen ?
- Is it better to create dynamic content tables and have different cell identifiers for different types cells (e.g. cells with slider / cells with text box etc) ?
If you’re using Storyboarding, this is a very easy thing to accomplish. Just add a new scene to your storyboard:

…then add a

UIBarButtonItemto your main scene:…then link the

UIBarButtonItemto the scene you just added by using Control+Click to drag from the button to the scene. Choose a “modal” transition:…then, in the new scene you’ve added, you can customize the table cells by using the right-hand side menu. If you choose “Custom” as the cell type, you can add switches, etc to the tableview.

From there, I’d recommend you take a look at hooking those switches up to methods, and then take a look at
NSUserDefaultsfor how to store the settings and link them up to this viewController. Here’s the documentation for NSUserDefaults.