Remove only one RightBarButtonItem

898 Views Asked by At

In navigation bar I'm adding two right barButtonItems:

[self.navigationItem setRightBarButtonItems:@[firstBarButton,secondBarButton]];

Now when I click over firstBarButtonItem want to remove it. I know when I have only one UIBarButtonItem I do:

self.navigationItem.rightBarButtonItem = nil;

How do I do when the rightBarButtonItems are two?

1

There are 1 best solutions below

1
On BEST ANSWER

Just set one of them:

[self.navigationItem setRightBarButtonItem:secondBarButton];