Navigation Bar not selectable in Show Segue, Xcode 6.1 - ios

There are 2 View Controllers in my storyboard, VC_A and VC_B
I have embeded a navigation controller in VC_A which is a Table View Controller, I then control drag the Prototype Cell into VC_B to create a segue. If I select "show" in "selection segue" then in VC_B I can see the outline of the navigation bar but I am unable to select it or add any bar buttons to it, it also doesn't appear in the hierarchical view.
However if I select the "push (deprecated)" option when choosing the type of segue, I am able to select the navigation bar in VC_B and add buttons to it, it also show up in the hierarchical view as a Navigation Item.
The only work around I can find is to choose show, then change the segue to push(deprecated) in the Attribute Inspector so the Navigation Item will show up in the hierarchical view, then change the segue back to show. But I am worry that this might cause problems further down the line.
Is there a way to add a Bar Button to VC_B's navigation bar without using the work around?

Just drag the "Navigation Item" from object library to the navigation bar and it should work as expected. You can make changes as you like and it works exactly like in Xcode 5.

Interestingly, when you first time made the connection b/w your table view controller and view controller using Push you can start editing the navigation bar without a problem (e.g put bar items onto it).
Then delete the connection between your table view controller and view controller (but do not delete the nav bar items you just added), then re-connect the two controllers by using segue Show, you will see the navigation bar works just like segue Push now.
Hope it helps

I think the way you do it (going through the deprecated push) is not wrong even though there's another way. In fact, when you turn the Segue into a push, you get a Navigation Item out of it.
So all you have to do is add a Navigation Item to your View Controller and that'll do the trick:

This seems Xcode bugs.
In my case, i am re-create segue by this sequence:
Delete existing seque. (I am using "Action segue - Show")
Drag new segue with "Non-Adaptive Action Segue - Push (deprecated)"
Delete segue no.2
Re-create/connect "Action Seque - Show". (No.1)
Done
Now, i can edit navigation title and add custom navigation item button as usually.
I am using Xcode 6.4, and minimal target iOS version 7.

In your viewController :
self.navigationItem.title = "Second VC"
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Play, target: self, action: "playFunction:")

Related

iOS navigation has no navigation item

In the current version of Xcode a few things seems to work a bit different.
I have a little problem working with a simple navigation. This is what I do:
I have a Storyboard with two scenes.
I connect the scenes with a segue of type "Show".
(In the past I did use "Push" but that is deprecated now.)
I select the first scene and choose "Embed in Navigation Controller.
Now both scenes will get a gray bar at the top but only the first scene will also get a Navigation Item.
Only for the first scene I am able to edit a title attribute and only for the first scene I am able to add a Bar Button.
Navigation itself works fine. The title of the first scene is the text of the Back-button in the second scene.
Why has the second scene no Navigation Item?
Is it because of the segue type?
Yeah, its a bug in Xcode from version 6. If you want Navigation Item in second view controller too, then there is a hack to get it.
Change the seque type from show to push. Now Navigation Item will appear in second VC too. You can again change the seque type from push to show, the Navigation Item will still present in second VC.
IB will automatically add UINavigationItem to root view controller of your UINavigationController.
To the rest of your controllers in navigation flow you need to add UINavigationItem manually from IB Object library.
What I do is to drag a navigation item from the list of controls to the top, gray bar on the second ViewController. Then you can drag other items such as bar buttons onto it, as well as being able to edit the title.

bar button item segue not adding navigation bar at top of next view

When I drag to the next view controller to add a segue the new view controller has no navigation bar with a back button. I thought that was the default when you add a segue to a new VC. I'm also not able to drag a navigation bar to the top of the table view controller. Am I doing something wrong? Thanks.
Maybe the problem is the kind of segue that you are you using. The Segue type should be "Show (e.g Push)". Click on the segue and in the right panel go to the "attributes inspector" (the 4th one). And here you can check the type.
A view controller like in your case only shows a navigation bar by default, when the view controller itself or one of its parents (connected by a push-segue) is embedded in a navigation controller. Obviously, the navigation controller must not have hidden the navigation bar.
So, you either forgot to put a navigation controller into play or your segue is modal and not push.
Well, it's two years since you asked your question, but when it happened to me, I realized it was because at one point, I had accidentally created my segue as a different kind of segue (a detail one, I think), but changing it back to a "Show" segue didn't actually change it's behavior. When I found the segue in my storyboard xml, it was listed as a "Show" segue, but with a different custom action that suggested it was going to do something completely different.
Anyhoo, deleting and recreating the segue in Xcode fixed it. I probably could have also deleted that custom action in the xml file, too.

iOS 8 Navigation Bar Not Accessible in Second ViewController on Storyboard

I am new to iOS development and have not tried this programmatically yet. I would prefer to get this working in a storyboard.
I'm following this somewhat outdated tutorial from XCode 4.5 in XCode 6.1 to create a series of views connected by one navigation controller.
http://youtu.be/rgd6mCuzlEc
Once I create the second view controller, I am unable to double click the navigation bar to change the name and I am unable to add a bar button to it.
I have a Segue going from bar button "Item" from view 1 to 2. Notice in the "View Controller Scene" there is no navigation item. If I add any elements to the view controller they fall under "View" and not under "View Controller", unlike view controller 1 where it falls under "one".
Is this a limitation on XCode? Am I using the wrong Segue (Show)? Is there a hidden setting or customization I'm missing?
I actually have this working for 2 view controllers and failing the 3rd in a separate project but I don't know what I did to do that so I'm pretty sure it's possible I just cannot reproduce..
EDIT: Workaround Instead of the new adaptive SHOW segue, use the deprecated PUSH segue, add the bar button items, then change back to the adaptive SHOW segue.
Try adding a Navigation Item to the controller and it should work properly

Custom segue causes navigation item to disappear

I'm using custom segues with no animation because I don't like the animation of the default segue. The problem is that in the storyboard, when I flip the segue style from Push to Custom, the view controller's navigation item disappears. Now, it seems that the navigation item still works even if the segue is set to Custom, but that means constantly flipping back and forth between Push and Custom when changes need to be made.
Is there any way to use a custom segue and still have IB access to the navigation item?
Yes, select the view controller and open the attributes inspector. Then change the "Top Bar" from "Inferred" to "Navigation Bar". That should keep the navigation bar displayed.

ios storyboard tabbar > ViewController > TableView

I would like to create the following navigation
I have a tab bar program build with storyboard
and I have a View controller with buttons
when I click a button A navigation controller is called
Right now I have made all the connections and everything works fine but..
in order to create the change from the button to the table view I am using modal segue and that removes my tab bar.
I know that push will not work cause its not a navigation but how can I work this out?
I had the same problem but I realized that the best option is do it using a push segue. It's the best option because when you have a table view into a tab bar item it's more usability, it's what customer want. I'm sorry for not solution your problem but I strongly recomend you to use push.

Resources