How to get reference to UIPopoverController when using adaptive segue?

前端 未结 3 632
别跟我提以往
别跟我提以往 2021-02-07 10:00

In my iOS 7 app, I detected if a segue was a popover via this check in prepareForSegue:

if ([segue isKindOfClass:[UIStoryboardPopoverSegue class]])
         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-02-07 10:37

    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.

提交回复
热议问题