I have the following situation: I begin with a login screen (which I want to have no toolbars or tab bars.) After the user has logged in, I want to display a tab bar with multiple options each of which can drill down into their own view hierarchy. Thus it is necessary for each of these tabs to have navigation controller capabilities.
Thus, the most immediate solution would be to have a tab bar controller and then have each section (3 in total) have their own navigation controller. However, the issue is that I want each page in the entire app to have a logout button which will bring them back to the very first screen.
I could have segues from every page's logout button back to the beginning but this seems wrong. I could also put the tab bar controller inside the navigation controller; however I've heard that navigation controllers should always be inside tab bar controllers and never the other way around.
Any suggestions
If the root view controller for each UINavigationController is the login screen, why not just make a logout button assigned to self.navigationItem.rightBarButtonItem for each appropriate view. When clicked, it can call your logout function and then popToRootViewControllerAnimated: to take you back to the login screen.
You can use setNavigationBarHidden:animated: in any view you want or don't want the navigation bar to be shown.
Present your "login" screen as a modal view controller on top of your tab bar controller of navigation controllers. Anytime you logout from anywhere in the app you present a new modal login view and can then reset the state of your other controllers while they are no longer visible. On login you dismiss the modal and reveal the tab bar controller and whatever it contains.
Related
I have a navigation controller with a table full of buttons that cause various settings pages to push in. I needed to add a new one, so I copied one of my existing ones, changed the VC, and off I go.
But there's no nav bar on the screen. I can see the navigation object in the storyboard and the editor simulates it's display. I compared it to the other pages that are displaying the bar, and they look the same.
I tried changing some settings, like "Hide Bottom Bar On Push" and that had an effect, but my attempts to get the bar to show up fail.
I looked at other questions that suggested it had something to do with naming, but I've tried various name fields - on the Navigation Item, the VC's Title, etc. - with no effect.
I am not sure, but the problem may be that in case the segue to the new View Controller Scene is set to modal, it would not have a Nav Bar, To be able to see one, you need to embed that in another Navigation Controller.
I am developing a UINavigationController based app where one of the view i am presenting is modal where i need a navigation bar which i have manually added but problem is the statusbar and navigation bar colors are different and both are translucent though, is there a way to set both same the way they appear on UINavigationController?
OK finally I think this is what i had to do ,
on presenting the view modally I am loosing the transluscent status bar instead get a transparent status bar,and also required to add my own navigation bar,thats how ios7 handles the status bar now, what i did is I wrapped the modally presented view into a navigation controller and then presented it , no changes i was required to do in segues just embedded the modal view controller in a navigation controller.
To embed a view in navigation controller in storyboard , just select the view go to Editor menu and select embed in-> navigation controller option.
I'm building an application for the iphone that uses both modal views and navigation-controllers. In my case, the initial screen is a table view within a navigation controller, and if the user clicks on the "+" button, they get a new screen that appears in a modal view sliding up from the bottom of the screen that will allow them to add a new record. Within this modal view I want to have a button that will allow them to select from a list of options.
To provide a quick example, take a look at this screenshot from the Apple documentation: https://developer.apple.com/library/ios/DOCUMENTATION/UserExperience/Conceptual/TableView_iPhone/Art/ui_navbarpurposes.jpg. If you look at the "Repeat" option in the second view, that's what I want to emulate -- the user will click on the option and a new view (not a action sheet) will load allowing them to select from a list.
Ideally, I would want this new option screen to slide in from the right like a new view was added to the navigation controller stack. However, since add record screen is a modal view, I can't do that, can I? Or would my modal view need to load my add records view embedded within a new navigation controller?
Hopefully I'm explaining this clearly enough. Sorry for any confusion!
Your last thought is the way to go: you need to add a navigation controller to your modal view, and then when they tap the table view row, you just push your next view onto the navigation stack.
I am creating a tab bar controller project but also want to have a login screen before showing this. i also want a settings screen and info screen to be available to view from the login screen. if login is successful, then show the tab bar view. also to log out from the tab bar view.
what is the best way of doing this? what type of project and how to do the login screen?
any help would be much appreciated!
first of all create the viewbased project.In the first viewcontroller add the login screen.After that in loginscreenxib create the object of tabbarcontroller.
I've seen lots of tutorials on how to build a simple app with 2 tabs and a navigation controller - especially when there is a table view where you click a row to see details (and have built this myself). But most apps I've seen have the detail view such that either the tab bar disappears or there is another type of nav bar at the bottom. Does anybody know how to extend the basic navigation controller and tab bar to get it to work to get it to work like this?
Here is the answer to my question
How to hide parent tabbar when pushing controller in navigationController