首页 > 解决方案 > 在swift中,如何在顶部保留一个UIViewController().view?like UIAlertController

问题描述

CustomAlertViewControllerUIViewController. 要呈现的当前代码片段CustomAlertViewController-

CustomAlertViewController: UIViewController {}
self.present(CustomAlertViewController(), animated: true, completion: {})

但我想CustomAlertViewController在视图层次结构之上添加。

任何建议如何实现这一目标?

标签: iosswiftuialertcontroller

解决方案


可能您想将 UIViewCotroller 的视图添加为关键窗口的子视图。检查这个答案:https ://stackoverflow.com/a/38540271/5779168


推荐阅读