tounaobun
tounaobun

Reputation: 14857

How to dismiss modalView tapping outside of the modal view

I have a segue which type is modal,and I set its presentationstyle to formsheet.

enter image description here

Here is the screenshot.

enter image description here

When I tap the dimmed view, the "popover" view doesn't dimiss itself.Is there any trick to dimiss itself when tapping outside of the modal view?

Upvotes: 1

Views: 2604

Answers (1)

tounaobun
tounaobun

Reputation: 14857

It can be achieved by using UIPopoverController class and modalInPopover property in UIViewController.Setting modalInPopover to true causes an owning popover controller to disallow interactions outside this view controller while it is displayed.The default value is false.Here is the full doc.

Upvotes: 1

Related Questions