I have an UIAlertController
(UIAlertControllerStyleActionSheet
) on iPhone which now should be presented in a UIPopoverPresentationController
on the iPad version..
I am doing the following:
UIPopoverPresentationController *popover = sectionActionSheet.popoverPresentationController;
if (popover){
popover.sourceView = self.view;
popover.barButtonItem = menuButton;
popover.permittedArrowDirections = UIPopoverArrowDirectionAny;
}
Unfortunately the position of the popover (in relation to the UIBarButton) is not so nice and if I rotate the device the popover is not repositioned:
Corner not centered:
After rotate: