push segue not showing my detail page - iphone

I have a tableview with about 10 items.
I have set up a UIView Controller as a detail page.
I Control-Drag from my cell in the tableview to the new view controller, and I can create a Push Segue, however the navigation control does not appear on the new view controller.
When I run the application my prepareForSegue method executes but my application does nothing. The detail UIView Controller does not display.
What step am I missing to make this work?

The Push segue only makes sense for ViewControllers embedded inside a UINavigationController. You can do this easily by selecting your tableview's ViewController in the storyboard and choosing in the main menu:
Editor -> Embed In -> Navigation Controller

Related

Show UITabBar on UIViewControllers that are not part of the UITabBar?

I have an iOS app written in Swift with UITabBarController with 5 UIViewControllers. Now, I have a bunch of UIViewControllers that are not part of the UITabBarController. I'd like to be able to show that same tabbar but I have no idea how to do that. Any clue?
More details: This is one of the View Controllers that the tabbar has. I use storyboard references and split my view controllers into separate more manageable storyboards.
So, the big picture:
There's no initial ViewController since I use storyboardId to get to the initial Navigation Controller. From there we have a ViewController embedded in the same Navigation controller. In that ViewController, there are 2 Container views - one of the size of the bottom ViewController that contains the "hamburger" button that toggles the other Container View which has an embedded UITableView in. When a specific cell is selected it should go to Profile ViewController that's not even in the same storyboard. The segue is set to be Push. Either way, doesn't show the UITabBar on the Profile ViewController
how you doing?
I don't know if I understood, but you are trying to show tabbar after going to another screen, right? If the answer is 'yes', try to change your segue to show(e.g. push).
-----Edit-----
You can do with two ways:
Presenting Modally -> using Current Context
Use push(e.g.) with a navigation view controller, you can also hide the navigation bar if you go to Navigation controller -> Attributes inspector -> Navigation Controller -> Uncheck Shows Navigation Bar
Hope now it works!
Best regards

Why doesn't the first navigationcontroller in my storyboard have an effect on the tableviewcontroller?

My Storyboard is setup as:
UIViewCont
/
NavigationController -> UIViewContr -> UIViewContr ----- UIView Contr
\
NavCont
\
TableViewController
The last three controllers (2 x UIView and 1 x TableView) use "show" segues from three different buttons. And the TableView controller is embedded in the NavCont.
Because the first controller is a NavController every UIViewController has a back button except the TableViewController.
I've been reading up about it but can't figure out why. Other than each Navigation controller is it's own stack and kind of starts again so you can't just navigate back from a 2nd or 3rd navigation controller. But not sure.
Thanks.
Using a navigation controller resets the navigation stack tracking, so your table view does not have a back button because it is effectively a new root. If you create a view controller that the table view segues to, it will have a back button because it is part of the (inner) navigation chain and not the root.
It is not apparent from your example what you are trying to do or why you have the inner navigation controller instead of just relying on the original navigation stack. There is one option you can try. The root view of a navigation stack should have the navigation bar, and you can drag bar button items onto it, allowing you to unwind back to the previous state.

How to navigate back from a navigation controller on the storyboard in xcode

I've got an initial view controller InitialViewController with a button "List" (and a few other random buttons).
Clicking on "List" segues to a UITableViewController that is embedded in a navigation controller. And that is all sweet.
But once the UITableViewController is loaded there is no "back" button to navigate back to InitialViewController.
I was just wondering what my options were. On the storyboard I've used a "Navigation Item" and "Button Bar" and i'll hook that up programmatically to navigate back.
I just wasn't sure if an unwind segue was an option or if anyone had better ideas.
Thanks.
The reason you don't see a back button when your UITableViewController is loaded is because it is the root view controller for the navigation controller that it is embedded in. As such, the NavigationController has no other view controller in the stack that it can go back to.
Instead of the TableViewController, embed your InitialViewController inside a NavigationController and that should add a navigation bar with Back button to your TableViewController.
If you don't want to show the Navigation Bar in your InitialViewController, you can hide it using the following steps:
In your storyboard file, select the InitalViewController
Open the Attributes inspector and set Top Bar to None
Hope this helps!

How to get NavigationController from Storyboard

I have a storyboard with a View Controller has my initial view. I am trying to segue to a NavigationController from a button click.
I can make the segue work when the button is clicked, but how do I get a reference to my NavigationController so I can populate my TableView?
Also, how do I make the table view go back to the initial view?
My Storyboard looks like this:
Thanks for the help.
First, in general we don't segue to nav controller, we segue with them, to another view controller. In theory, your segue will only work (unless you have done a lot of unnecessary coding) if you have properly setup the storyboard to make the Navigation controller the "initial" view controller, and your first View Controller as it's "root view controller" (most easily accomplished by the menu's "Embed in... > Navigation Controller" command).
Then in your code, you always have a simple access point for your nav controller: Any view controller which is currently in the stack of controllers managed by a nav controller can simply use it's navigationController property to access it. You can then use it's interface to popViewControllerAnimated: or similar.
In your View Controller, implement
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
and get your NavigationController via segue.destinationViewController.
But if you want to go back, you probably want the ViewController with the button to be connected to the NavigationController, not the other way around.
NC => VC with button -> TableVC
where => is a relationship segue and -> is a push segue.

Why i can not push a view controller in my navigationController?

In my navigation based application, first view is sign in or signup view. After that i am using a view which is using tab view controller. That view has three tab items. Now i want to create a new view and push in navigationController. But its not working. But adding new view as subView in tabBarController View works. I want navigation for subViews for each tabBarItem? How can i do that?
See this
In your case just create three items and make them all UINavigationControllers like the first tab item in the above example.