Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating iOS-like settings screen

I have been researching how I can create a settings screen for my app that looks identical to the iOS settings app however I haven't been able to find an iOS 7/8/Swift version. I have a custom designed settings screen currently, however it just doesn't look professional enough and I would like something that looks more 'iOS'.

Something like this would be perfect: http://jomnius.blogspot.co.uk/2011/04/easy-way-to-create-settings-view.html but obviously this won't work now.

I was hoping someone could recommend a way that allows me to do something similar to this?

like image 516
user3746428 Avatar asked Jul 25 '14 22:07

user3746428


People also ask

What is form SwiftUI?

A Form in SwiftUI is a container view which allows you to group controls used for data entry.

Where is applications in settings?

On your phone, open the Settings app. Tap Apps. Tap the app you want to change. If you can't find it, tap See all apps.

What is per app settings in iPhone?

Per-app Accessibility settings let you enable features for specific apps or override your global Accessibility settings.


2 Answers

Like 'Epic Byte' stated above, going with a UITableViewController with grouped style is an approach that ended up working for me. That tip put me down the right path.

Here are some links that helped me get the job done (in my case I also needed this to appear in a tab bar controller):

  • http://useyourloaf.com/blog/static-table-views-with-storyboards.html
  • http://www.appcoda.com/storyboard-tutorial-create-tab-bar-controller-and-web-view/
  • http://shrikar.com/xcode-6-tutorial-grouped-uitableview/

Note that even though the screenshots appear to be for iOS versions < 8, the mechanics in the storyboard view carry over.

like image 149
Mike Avatar answered Nov 13 '22 15:11

Mike


The above answer is correct, but I wanted to add the solution itself here to save time for future users.
In order to make a regular UITableView look like the "Settings" page, you only need to to two things:
1. implement tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int and tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? so that the table will have multiple sections with headers.
2. set the table style to .grouped, which can be done via the storyboard editor.

like image 27
Rom Avatar answered Nov 13 '22 16:11

Rom