Adding Bar Button Item to Left of Navigation Item

LondonAppDev picture LondonAppDev · Mar 22, 2014 · Viewed 31.1k times · Source

I am following this tutorial on adding a sidebar navigation to an app.

In the given source code they have provided the storyboard layouts pre-defined. One of them is a view that has a "Navigation Item" and a "Bar Button Item" which appears on the left of the top navigation bar.

I am trying to do the same in my app, however the button item keeps automatically appearing on the right, and I cannot find any way to move it to the left.

I noticed, in the example provided in the tutorial, it gives this outlet option leftBarButton option:

enter image description here

And when I check mine, it looks like this:

enter image description here

There is no navigation controller because of how SWRevealView works. When I run the app, I can see the button and it works perfectly, only issue is it's on the right hand side. I've compared my view with the example, and cannot seem to find any difference.

Any help is appreciated.

EDIT This might help. In storyboards, this is what the working example looks like:

enter image description here

And this is what mine looks like

enter image description here

Answer

Amit picture Amit · May 24, 2014

Drag BarButtonItem and place left side on your navigation item.