gpt4 book ai didi

ios - 关闭弹出窗口时执行功能

转载 作者:行者123 更新时间:2023-11-28 06:28:06 25 4
gpt4 key购买 nike

我有一个弹出窗口使用调用它的相同 View Controller 。

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "groupSelect" {
let popVC = segue.destination
popVC.popoverPresentationController?.delegate = self
}
}

func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}

但是,因为我使用 Storyboard来制作所有内容,所以我不太确定当弹出窗口消失时我如何或在何处接管或添加代码。在带有 Swift 3 的 Xcode 8.2 中,使用 Storyboard编辑器添加弹出框会自动使弹出框在用户触摸弹出框外部时消失。一切都很好,唯一的问题是当我从弹出窗口返回时,它下面的表格不会调用重新加载函数,因此在弹出窗口中所做的任何更改都不会对用户生效。

最佳答案

实现 UIPopoverPresentationControllerDelegate 方法 popoverPresentationControllerDidDismissPopover 告诉委托(delegate)人弹出窗口已关闭。

关于ios - 关闭弹出窗口时执行功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41202690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com