0
votes

The incorrect navigation bar is appearing on my Table View Controller screen (see Storyboard Below).

Storyboard

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 -

Output

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!

1

1 Answers

0
votes

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:

  1. When you initialize the UITabBarController, set it's navigationController's navigation bar property to "hidden"

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