0

我的 viewController 上有 YTPlayerView。如果我创建 UIAlertController 并通过方法显示它self.present(alertView, animated: true, completion: nil),警报将显示在播放器视图下。如何在我的 viewController 上的所有视图之上显示 alertView?

这是我现在使用的代码:

let title = "test alert message" let alert = UIAlertController(title: title, message: nil, preferredStyle: UIAlertControllerStyle.alert)
    alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
    UIApplication.shared.keyWindow?.rootViewController?.present(‌​alert, animated: true, completion: nil)
4

0 回答 0