Reputation: 608
My iOS application contains login page. And after entering the app there is a logout button. When a user presses the logout button programmatically I want to show login page again as if the user is logging first time. Could you please suggest how I could implement this in my iPad application.
Upvotes: 0
Views: 3331
Reputation: 41642
I do this in my app. I have a tabbarcontroller that i use for logged in users. When they log out (or for first time use) I message the appDelegate that removes the tab bar from the window and makes the login view the root view. Once logged in, that view is replaced by the tab bar controller.
I even go a bit further. On each switch I totally release all the other objects, and so I know for sure that when user sees any of these views it's completely 'fresh' and only uses the defaults for anything custom to that user.
Upvotes: 2