Search code examples
iosuinavigationcontrolleruisplitviewcontrolleruibarbuttonitem

UIViewController custom back navigation button


Here's my scenario:

I'm using this open source library https://github.com/SlavaBushtruk/APSplitViewController to create a pseudo splitviewcontroller.

Here's what it looks like so far

enter image description here

The APSplitViewController is pushed from another view within a tabbarcontroller.

When I pushed the APSplitViewController it adds an additional navigation bar to the very top of its view, I have hidden that bar because my "sub" views have their own navigation bars.

I would like to add a button to the left of the blue view that would simulate the actual navigation controllers back button (which is currently hidden)

If I can get it to look look like the back arrow that would be great, if not I can live with just a button that says back.

Any help would be appreciated.

=========

Okay I have added a button like so.

self.left.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Test" style:UIBarButtonItemStylePlain target:self action:@selector(backAction)];

Now if I can just get it to look like the back arrow It would be perfect :)


Solution

  • You can get an image that looks like the back button.