Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have 2 leftBarButtonItems in iPhone app, and 1 be the default back button?

I would like 2 leftBarButtonItems, but leave one of the items as the default back button for Navigation Controllers. I have set up:

self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:archives, ???, nil];

where archives is a UIBarButtonItem I created, but do not know what the default back button is to include in the array. Any suggestions?

like image 888
user717452 Avatar asked Apr 16 '12 19:04

user717452


1 Answers

Make sure you set leftItemsSupplementBackButton to YES.

self.navigationItem.leftItemsSupplementBackButton = YES;
self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:archives, nil];
like image 125
Sebastian Celis Avatar answered Oct 21 '22 11:10

Sebastian Celis