Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popping to rootview controller #75

Open
tharrington opened this issue Jun 26, 2014 · 2 comments
Open

popping to rootview controller #75

tharrington opened this issue Jun 26, 2014 · 2 comments

Comments

@tharrington
Copy link

If I have a navigation controller with the following structure:

nav -> login -> slideout -> three view controllers

from one of my view controllers in the slideout, I want to pop to the root view controller or the login controller. Is this not possible? From the view controller, a user hits a logout button and then they should pop back to the login screen:

viewcontrollerInSlideout *my_vc = [self.navigationController.viewControllers objectAtIndex:0];
[self.navigationController popToViewController:my_vc animated:YES];

@andreamazz
Copy link
Owner

Hi @tharrington
You might want to switch your main window's rootviewcontroller to the slide out controller once the user is logged in, and switch it back to your login view controller once he logs out. You can do this from your app delegate, when the app launches check wether the user is logged in or not, and set the appropriate view controller as root. You can then use local notifications to send messages to the app delegate when you want to switch interfaces back and forth.

@drallgood
Copy link

Or you could just hide the navbar (and sidebar) on the login page.
This might depend on whether you are planning on showing the sidebar in the future (e.g. to give users access to a help section even if they aren't logged in).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants