tab bar goes when going between views - ios

I am developing a tabbed bar application using storyboards.
I am attempting to put in a back button one a view - but when I press to go back (from one view to another) the tab bar vanishes.
How can I ensure the tab bar stays there?

Just make sure you're adding the UITabBar to the main Navigation Controller or View Controller of Navigation Hierarchy.

You need to select Tab Bar on the Navigation Controller Bottom Bar under the Attributes Inspector, then set the bottom bar to Inferred for the rest of your pages (or Tab Bar if you want it to be different on any pages)

Related

View controller problems with old navigation bar and tab bar controller

I have a view controller which was attached to a navigation controller at one point in time. it is still showing some ghost of the navigation bar? It is also showing the Tab Bar but there is not tab bar item shown on it?
any ideas how to fix this, or is it a delete and remake?
Its either the alpha of the rootVC or you have. tab bar controller on the second one. Check your identity inspector on both views

iOS tab bar controller adding a navigation button at the top of the controller

So I have a UITabBarController and it has three buttons on the bottom in my iOS app. I want to add another set of buttons at the top but not quite sure on how to do this. I tried adding a UINavigationBar and a navigation button, and adding a view in to it, adding just the buttons, ect.... but to no avail. It won't let me add anything to the UITabBarController. Is there a way to do this?
Thank you very much.
the simplest way to that is to creat 3 buttons side by side and set their frame the way they divide the top of screen to 3 equals. it means u can create a tab bar with buttons manually.
but there's another way. i think this answer would help u
Positioning UITabBar at the top
To use the navigation bar you need a navigation controller. Now depending on your needs your tab bar controller should be inside a navigation controller or the other way around. If you want to be able to navigate away from the tab bar controller (have a screen without the tab bar) you should embed your tab bar controller into a navigation controller. If you only need the navigation bar for some tabs of the tab bar controller or you still want the tab bar to be visible all the time you should embed all (or just the ones than need a navigation bar) your root view controllers for each tab in navigation controllers. Finally if you do not need the navigation behaviour you could just put a regular view in the view controller that needs the bar at the top and some buttons in it and make them look the way you want.
You can embed a view controller in a navigation controller in a storyboard by selecting the view controller and the going to Edit->Embed in->Navigation controller.
Select the Any Tabbar ViewController then above the Menu -> Editor -> Embed In -> Navigation Controller its select, if you get the Navigation Controller then if you add the Navigation Button at Top of the ViewController, example :

Why doesn't my Tab Bar show up in the simulator?

I have a tab bar controller that controls 4 view controllers. When I run the simulator, the tab bar doesn't show up. I created the tab bar controller in a single page application by dragging it from the object library, then creating segues with ctrl-drag for views that had already been created.
I do not have a navigation controller.
The problem was that I did not have the Tab Bar Controller selected as Is Initial View Controller in the Attributes Selector. After checking this box, the tab bar showed up at the bottom of the simulator.

iOS Swift: Incorrect Navigation Bar Appearing

The incorrect navigation bar is appearing on my Table View Controller screen (see Storyboard Below).
I would like what's displayed on the storyboard to be my navigation bar (i.e. with "Main Feed" title and Sign Out button on the top right). However, this is what I'm actually getting -
There are two issues here: 1) The incorrect navigation bar is displaying (this one has a login back button); 2) the first few table view cells are placed underneath the nav bar vs. under it.
This happened after I embedded the Table View controller in the Tab Bar Controller. I want a bottom tab bar in the main portion of my application hence the reason why I added the Tab Bar Controller. Any suggestions on how to fix this? Rather than using the Tab Bar Controller in storyboard, is there a way to do this programatically? Thanks!
The navigation bar that you are seeing on top of the stack is the navigation bar from the UITabBarController itself, that is why you are seeing the back button show "login". There's a few ways to work around this, programmatically:
When you initialize the UITabBarController, set it's navigationController's navigation bar property to "hidden"
Go through each view controller form the beginning of your app up to where you first see this problem and in the "init" method of the viewController you are testing, set the navigationbar to hidden. Something like, self.navigationController?.navigationBar.hidden = true;
This is how you can "debug" this issue, but it's going to take some tweaking to get it right.

How to properly combine a Tab Bar View and Navigation Bar in iOS

In my iOS application I have a tab bar view with three views. I would like each of those views to have a "navigation" bar at the top. I would like the navigation bar to have a left bar button item which has the same functionality across all three views, and then a right bar button item which is unique to each view. How should I build this?
In each tab, put a UINavigationController. That's a separate one for each tab.
Set the root view controller of each navigation controller to a view controller that manages the content view you want to display.
You can set the left button item of each of the three navigation controllers to the same thing, and set the right button item to something different.

Resources