Question

I'm using Settings.bundle for few configuration settings for my app.

Now I'm searching for a solution to hide all, or even better, some configuration parts for the casual users. Only a 'admin' should see and edit these fields.

Is it possible to check for a password before showing the settings-properties? If not, what could be a suitable solution? (new view controller with secret gesture or button?)

Thx in advance!

Was it helpful?

Solution

You won't be able to do anything special in the settings bundle. It's static, whatever you compile is what all users will see. If you want special behavior, there are two ways to do it:

  1. Put it in the app itself and only allow the user access if they have the right credentials. A secret gesture could work too, but is a little dangerous because users may accidentally find out about it.

  2. Use a different target/scheme or compile-time conditionals (using #if) to build two different versions of the app, one that does include the special configuration and one that doesn't. Personally, I would go for this option, but it may be a little harder initially.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top