View controller problems with old navigation bar and tab bar controller - ios

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

Related

Swift unable to add tab bar to tab bar view controller? Grayed out?

Ok, my experience with tab bar controllers is limited but Ive never encountered this issue. I am able to create a tab bar controller but not add a tab bar or tab bar item tp it. I have followed this : https://makeapppie.com/2015/01/27/tab-bar-controllers-in-storyboards/ and others exactly and they just say to drag in the tab bar controller or embed another VC in it and boom - tab bar.
This is what has happened for me:
The tab bar is grayed out and Im not able to drag a tab bar onto the VC or anywhere. What am I doing wrong here? I need to migrate my standalone VCs into a tab bar controller.
make sure to your relationships between view controllers and view controller
this is my tabbarcontroller

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 :

Weird nav controller behavior with different tab bar stacks

I have a tab bar controller with a nav bar embedded in each tab as root. I am using a detail view controller that will be accessed from 2 of these tab bar stacks. When accessing this view controller in it's own stack, everything works as expected. However, if the user is in the other tab and segues to this detail view controller, the view slips behind the navigation bar. Its like the nav bar isn't even there, it just goes underneath it. I've been scratching my head trying to figure out what's going on, any insights would be greatly appreciated!
Figured it out for those in a similar predicament. Need to add navigationController?.navigationBar.translucent = false in viewDidLoad. In iOS 7 this changed, by adding this line it won't slide the view beneath the nav bar.

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.

tab bar goes when going between views

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)

Resources