How to get reference to UIPopoverController when using adaptive segue?

前端 未结 3 625
别跟我提以往
别跟我提以往 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:50

    This may not be the most foolproof way to do it but you could check the popoverPresentationController property on your destination view controller. From there you can configure the popover anchor and such.

    Check the "Configuring a Popover for Display" section of the UIPopoverPresentationController doc. (Not sure if we're allow to link to them at this point, are we?)

    Note too that now we're talking about UIPopover*Presentation*Controllers, not UIPopoverControllers. It's a little confusing...

提交回复
热议问题