andreamazz / SlideOutNavigation

SlideOut Navigation Controller for iOS.
MIT License
210 stars 49 forks source link

popping to rootview controller #75

Open tharrington opened 10 years ago

tharrington commented 10 years ago

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 commented 10 years ago

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 commented 9 years ago

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).