我的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)