Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Back button does not show up in navigation controller

I have added a show segue from table cell in one view controller to another table view embedded in a navigation controller. When I click on the cell in the first view the segue works as expected and brings up the new view. However, the "Back" button (with the title of the original view) does not appear in the navigation bar.

I searched SO and found a number of such questions asked in the past (both for Swift and Objective-C). Most of them suggest that the first view needs a title for this to work. I do have a title. I even added one programmatically, just in case. That did not help. One of the answers suggested to add an identifier to the segue; that didn't help me either.

How else can I debug this issue?

xcode windowmain windowdetail window

like image 930
Vijay Avatar asked Jul 19 '16 02:07

Vijay


People also ask

How do I go back to the previous view controller in IOS 4?

Open your storyboard where your different viewController are located. Tap the viewController you would like your navigation controller to start from. On the top of Xcode, tap "Editor" -> Tap embed in.

How do I add a back button to my storyboard?

Storyboard. You can also set this in the Storyboard. Select UINavigationBar and select the Attributes Inspector tab. Then you can change those two images under Back and Back Mask attributes.

How do I add a view controller to my navigation controller?

Step 1: Embed root view controller inside a navigation controller. In your storyboard, select the initial view controller in your hierarchy. With this view controller selected, choose the menu item Editor -> Embed In -> Navigation Controller .


1 Answers

It seems like the problem is that you are pushing into a totally new navigationController, remove it, and make segue dirrectly into the new view Detail itself, they have to be in the same navigationController to work

like image 172
Tj3n Avatar answered Sep 28 '22 13:09

Tj3n