I'm updating an app to use universal storyboards.
(我正在更新一个应用程序以使用通用情节提要。)
I've created a popover segue to a new viewcontroller using interface builder by dragging from a button to my new viewcontroller and selecting 'Present As Popover' as the kind of segue. (我已经使用界面构建器通过将新按钮从按钮拖到我的新的ViewController中并选择“ Present As Popover”作为弹出按钮,为新的ViewController创建了一个弹出按钮。)
When the user presses outside of the popover (dismissing it) I need to be notified in the presenting view controller so I can undo their actions.
(当用户在弹出窗口外按下(将其关闭)时,需要在呈现视图控制器中通知我,以便我可以撤消其操作。)
How can I do this? (我怎样才能做到这一点?)
Normally I would have created the popover manually and made my viewcontroller the popover's delegate;
(通常,我会手动创建弹出窗口,并使ViewController成为弹出窗口的委托。)
allowing me to use the popoverControllerDidDismissPopover delegate call back. (让我可以使用popoverControllerDidDismissPopover委托回调。)
However, this is deprecated in iOS9 and even if it wasn't I've no idea where to find the popover so I can set its delegate to my view controller. (但是,iOS9中不推荐使用此方法,即使不是,我也不知道在哪里可以找到弹出窗口,因此可以将其委托设置为我的视图控制器。)
ask by Mark Bridges translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…