Adding settings to your iOS app

Abhimuralidharan
6 min readMar 29, 2017

Source: Apple docs.

I will tell you the reason why I am creating this article. Normally all my apps used to have login and logout option. So , to reset the app data I just had to click on logout button and it will call a routine function which will clear all the database data and userdefaults data. But, in one of the apps that I have made recently, I wanted to reset the app data once in a while. But the saddest part is that it didn’t had a login/logout option. Also, I didn’t want to add any button from inside the app to clear the data. This app had facebook and google subscription button in two different places inside the app which will go away once the subscription is successful. So, the testers had to reinstall the app four times to check this feature every time. I wanted to add a reset button so that testers can test this feature without uninstalling the app.

I also wanted to add the version and build number in the settings.

In iOS, the Foundation framework provides the low-level mechanism for storing the preference data. Apps then have two options for presenting preferences:

  • Display preferences inside the app.
  • Use a Settings bundle to manage preferences from the Settings app.

This what apple says in the official docs.

So an app can either show the settings inside the app or in the phone settings. Which option you choose depends on how you expect users to interact with preferences. The Settings bundle

--

--