Search code examples
iosiphonesettingsreview

Is it allowed by Apple to have the Signout function from the Settings?


Is it allowed, by Apple, to have the Signout function from the Settings page?

I just want the app to be as clean as possible so we don't have any Signout function from within the app itself =)


Solution

  • As you might notice in the docs, settings bundles are "dumb UI" -- that is, your bundle provides to the Settings app a list of NSUserDefaults keys for storing your app's preferences, along with a high-level specification for how they're to be presented in the UI... but there's no way to provide executable code for directly responding to changes made in the Settings app, drawing custom controls, etc.

    So you can't just put a button in Settings that signs the user out of your service when tapped -- you can, as JoePasq suggests, add a switch or other control to the effect of "sign out on next launch". That switch can set a value in NSUserDefaults, which your app can then read when launched and react to accordingly.