Dismissing a Popover
An important feature of a popover’s configuration is whether and to what extent the user can operate outside it without automatically dismissing it. There are two aspects to this configuration:
- If this is YES for the popover controller’s view controller (or for its current view’s controller, as in a tab bar interface or navigation interface), the popover is absolutely modal; any tap outside it will be ignored — such a tap won’t have any effect at all, not even to dismiss the popover. The default is NO.
This matters only if
modalInPopoveris NO. It is an array of views in the interface behind the popover; the user can interact with these views, but a tap anywhere else outside the popover will dismiss it (with no effect on the thing tapped). If
passThroughViewsis nil, a tap anywhere outside the popover will dismiss it.
Setting a UIPopoverController’s
passThroughViews might not have any effect unless the popover is already showing (the UIPopoverController has been sent
A popover can present a modal view internally; specify a
UIModalPresentationCurrentContext (and a transition style of
UIModalTransitionStyleCoverVertical), because otherwise the modal view will be fullscreen by default. A modal view’s
modalInPopover is effectively YES; while it is showing, the user can’t make anything happen by tapping outside the popover, ...