In my iOS 7 app, I detected if a segue was a popover via this check in prepareForSegue
:
if ([segue isKindOfClass:[UIStoryboardPopoverSegue class]])
There actually was no need to get a reference to the popover for iOS 8. You can access the popoverPresentationController
directly in the view controller that's presented. Then use dismissViewControllerAnimated
to dismiss the view controller. You can set the popover content size directly in the view controller that's being presented via preferredContentSize
. I found I had no need to obtain a reference in prepareForSegue
, at least when running on iOS 8. iOS 7 is a different story.