I'm using a storyboard segue that presents a view controller as popover. The seque has a custom UIView
as its anchor. On pre-iOS9 the popover would correctly point to the centre-bottom of the custom UIView
(presented below the UIView). On iOS9 it points to the top-left corner of the UIView
.
I did try to trace all selector calls to the custom UIView
to find out if there is anything I may need to implement in my custom UIView
to provide the 'hotspot' for the popover but couldn't find anything
Any ideas..? Thanks
Thanks to @Igor Camilo his reply - in case it's useful to some, this is how I fixed this in my code:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
UIPopoverPresentationController* possiblePopOver = segue.destinationViewController.popoverPresentationController;
if (possiblePopOver != nil) {
//
// iOS9 -- ensure correct sourceRect
//
possiblePopOver.sourceRect = possiblePopOver.sourceView.bounds;
}
...
}
Example: 'Short' button triggers a popover, the popover points to the top-left corner of 'Sort' control