Search code examples
iosuinavigationcontrollerstoryboarduistoryboarduibarbuttonitem

Issue while placing Bar Button on Navigation Bar


I want

to add a bar button on top right of my navigation bar.

I drag

and drop the bar button from UI Library into my navigation bar. It places my bar button in the bottom of the view instead.

enter image description here

How can I prevent this from happening again?


Solution

  • You need to drag a navigation item onto your view controller first (also from the library). Then you can add the bar button item by dragging it into the navigation item.

    navigation item