0
votes

I have a navigation bar in my app. I have to have 2 UIBarButtonItems next to each other, which i have put in a UIToolbar, and that UIToolbar is assigned as the rightBarButtonItem of my view controller like:

self.navigationItem.rightBarButtonItem = rightToolbarButtonItem

where the rightToolbarButtonItem is a toolbar, in turn having 2 buttons. Now, on clicking any of the bar buttons, i have to show a UIPopoverController. So i use:

presentPopoverFromBarButtonItem: permittedArrowDirections: animated:

But, in both cases, my popover arrow direction is the same. because it is taking the whole toolbar as a buttonItem. I want to show the arrow direction according to the bar button items in the toolbar.

Is there a way out?

1

1 Answers

1
votes

I made it work by presenting the popover from rect instead of presenting it from barButtonItem and hardcoded the rects for both the barButtonItems.