ios - popoverPresentationControllerDidDismissPopover 的替代方法?

标签 ios swift

我刚刚发现popoverPresentationControllerDidDismissPopover方法已被弃用。
什么是替代方法?

最佳答案

看来 UIPopoverPresentationControllerDelegate协议(protocol)包括 UIAdaptivePresentationControllerDelegate协议(protocol),它有

    // Called on the delegate when the user has taken action to dismiss the presentation successfully, after all animations are finished.
    // This is not called if the presentation is dismissed programatically.
    @available(iOS 13.0, *)
    optional func presentationControllerDidDismiss(_ presentationController: UIPresentationController)

presentationControllerDidDismiss()弹出窗口被解除时似乎被调用。

关于ios - popoverPresentationControllerDidDismissPopover 的替代方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59045058/

相关文章:

ios - 是否可以将文件保存在 NSDocumentDirectory 中的自定义文件夹中

ios - CAGradientLayer 无法正常工作

ios - 动画在 ios playground 中不起作用

model-view-controller - 在 Swift 中删除类实例

ios - Alamofire 出现 kCFStreamErrorDomainSSL 错误

ios - RxSwift、MVVM、Alamofire/Moya。使用间隔更新股票代码

ios - 当 View Controller 仍在 View Controller 堆栈中但不可见时,如何防止 MKMapView 消耗太多内存?

ios - 将 JSON 对象传递到 TabBarViewController

swift - iOS - Collection View 是否将每个单元格都保存在内存中?

swift - 如何在 Swift 中通过 ImageView 创建自定义文本字段