PopoverPresentationController 在接触外部时不会被解雇

PopoverPresentationController not getting dismissed on touching outside

我有一个 PopoverPresentationController,它从如下按钮显示。

我想在单击外部弹出窗口时关闭此弹出窗口。单击内部弹出窗口不应关闭它。下面是我的代码。

_popup = [self.storyboard instantiateViewControllerWithIdentifier:@"PopupViewController"];
_popup.modalPresentationStyle = UIModalPresentationPopover;
_popup.popoverPresentationController.sourceView = self.button;
_popup.modalInPopover = TRUE;

[self presentViewController:_popup animated:TRUE completion:nil];

我该怎么做?

删除这一行:

_popup.modalInPopover = TRUE;