So I have this UIButton, when clicked it triggers a UIPopOverController.
The UIButton is located in a Bar Button Item, in a Toolbar that has a 960 value for y. An iPad view.
My problem is, this button shows the PopOver at the top of the screen, whilst another button on the same toolbar shows the PopOver correctly (direction up).
I tried forcing the direction and changing buttons location on the toolbar but it didn't work. I tried the frame value for the toolbar but that brings it only from the middle. Here is the code for button action.
[self.popOverController setContentViewController:self.legendViewController];
[_popOverController presentPopoverFromRect:self.btnLegend.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES ];
I know that there could be a few functional ways of doing this. I am starting to think that this specific UIButton is cursed.