0
votes

I know the questions has been asked multiple times, and I went through the regular steps detailed in some of the posts but it didn't work. Clearly am missing a small detail that is leading to this unexpected behavior.

I have a tab bar controller from which there is a VC that inherits from UITableViewController (annotated as VC1). When I click on a row in the table, it takes me to another view (annotated as VC2) which shows the details. I want to have the navigation bar shown in the details view but it is not. I tried the following options:

  • I tried to set the segue as Show type and Show Detail type. Didn't work.
  • I tried in viewWillAppear to do self.navigationController?.navigationBarHidden = false, but that didn't work either.
  • I tried in viewWillAppear to do self.tabBarController?.navigationController?.navigationBarHidden = false, but that didn't work.
    • I embedded a navigation controller, but again no luck.

Can someone please outline something I could be missing?

Image of the flow has been added with annotations.

enter image description here

2
what did you use as your segue from tableview cell to the view controller is it show - Chanaka Anuradh Caldera
@Graham as stated in the post, I tried both Show and Show Detail - ksa_coder
try like this , delete your navigationcontroller between tabbar and tableview, then made a connection between tab bar and tableview and select view controllers under the relationship segue. then select your table view controller, select editor and choose embed in and then select navigation controller. put segue between tableview controller and other view controller as show - Chanaka Anuradh Caldera
@Graham isn't that exactly what's happening here already? - ksa_coder
for me it is working.it should work - Chanaka Anuradh Caldera

2 Answers

0
votes

Make sure for top bar here it says Inferred and not none.

Top right corner where it says status bar should be inferred

0
votes

Try to use a detailViewController, check out the Master-Detail template in Xcode. Maybe it is an Xcode bug, try to restart Xcode or recreate the ViewControllers