Bar button item not showing - ios

The navigation bar button is not showing in my project. I have created this demo project below to illustrate it. As you can see, the right bar button item is only showing on the greyVC and not the yellowVC. I might be able to add it programatically but that would be my last resort. I want to figure out why it is not showing with this storyboard way.

Do it like this:
And i Got the Bar button In Both the screens..

Related

iOS navigation items animates differently when clicked

I need to change the text and action of the navigation item, currently, I am doing it by providing the bar button items. But my problem is when I click it, it shows click only on the item I clicked not all the items I have added to leftBarButtonItems.
I tried using a custom view(UIBarButtonItem(customView: UIButton())). But It becomes smaller and I was not able to resize it. Please see the below image to understand the problem I am having. This is the situation after clicking on the back button. Thanks for your time.
please use custom navigation bar
https://www.youtube.com/watch?v=zS-CCd4xmRY
I hope this is helpful for you

Can't select tab bar items, greyed out tab bar

My nav bar is completely greyed out. I've seen some solutions like this saying that you should simply add an image to the tab bar item. I can't even select a tab bar item...see screen below.
Any ideas? I'm running Xcode 7.2, using Swift with a BaaS (Parse). I've searched for hours/days and can't figure this one out...May sound like a dumb question, but every other example I search essentially shows a tab bar with items that you can select/edit within the interface builder. As I can't figure out how to select a tab bar item within the interface builder, I've essentially been stuck. Do I need to do this all programmatically (I know some people have preference here), or can it be done in interface builder?
I add them as has been mentioned (using a view controller relationship segue, images below), but after I add it, everything is still greyed out and I don't have any tab bar items. Any ideas?
control-click action, using relationship segue under view controller
everything is greyed out, no tab bar items available to edit or add images to
Ok, here we go. You have a Tab Bar created.
Drag a View Controller to your storyboard. Place it next to your Tab Bar.
Ctrl-click on the Tab Bar and drag it to the View Controller.
Select the option like the image below.
About this this you must see the item on your tab bar. Click on it and you'll be able to edit (choose an image, change the label...).
Hope that helps.

Dragging Bar Button Item to Navigation Controller fails

I am following a tutorial on Udemy about Navigation Controllers.
The instructions are to drag a Navigation Controller onto the storyboard, and then drag and drop a Bar Button Item on the right of its navigation bar to segue to another view controller.
However, when I drag the Bar Button Item to its would-be position on the navigation bar, no drop-zone gets highlighted, and the button gets added to a random tab at the bottom of the screen.
I have tried finding references to this problem but all solutions are programmatic and given the wysiwyg nature of iOS development I would like to solve it through XCode UI.
Is there some setup I must change or is this an XCode 7 discrepancy?
Try to add a ViewController and then in Editor -> Embed in -> NavigationController. Then it should work.
I have solved my problem by dragging the Bar Button Item into the Document Outline, below Root View Controller.
This automatically creates Left Bar Button Items and Right Bar Button Items, which gives you an opportunity to drag the Item in the section of the controller you like.

Why can I not drag UIBarButtonItem onto navigation bar?

I'm having a little bit of an issue. When I place the UIBarButtonItem on the tab bar controller it works perfectly, it displays as it should:
However, I can't put a button onto where the black square is. Does anyone know how I could do this non-programatically?
You should probably add a Navigation Item by dragging it from the Object Library to the place where you have marked in black and then try adding a Bar Button Item on the right. It should work
UINavigationBar wants only UIBarButtonItem. You can create one with custom View programmatically. Show here: https://stackoverflow.com/a/16058345/717193

How to manually add a Back button to my NavigationBar?

I would like to know how I can add a back button to my UINavigationBar, I know that If I embed in a Navigation Controller in my main view, that all of this would happen automatically, but that is not what I am trying to do, in fact, the back button could go to any other view I connect the segue to, doesn't even have to be the back.
The back button needs to be the system navigation "back" button, I don't want to have to set image files for my buttons.
I tried dragging in a bar button item in storyboard but nothing shows up, doesn't seem to be doing the trick. The navigation bar was dragged to the view in storyboard (not created programmatically) and it shows up just fine.
I looked at the following similarly asked questions:
-> How do i add a 'back' button to a UINavigationBar manually?
-> How to add a button to UINavigationBar?
-> How to programmatically add a UINavigationBar and a back button on it
but they all point to just embedding the view in a navigation controller, which again, is not what I am trying to do.
If someone can please help me out, provide some sample code I would greatly appreciate it.
Try drag-drop a UIButton object. I have always added manual back button (hardly took the in-built one)

Resources