0
我有两个UIAlertController可以显示 - 一个用于注册一个帐户,另一个用于登录。他们可以提供一个可选的消息。UIAlertController消息不会显示
func present(alertController: UIAlertController? = nil, message: String? = nil) {
self.currentAlertController = alertController ?? self.currentAlertController
self.currentAlertController.message = message
(UIApplication.shared.delegate as! AppDelegate).window?.rootViewController?.present(self.currentAlertController, animated: true, completion: nil)
}
它看起来像消息通过函数进行。
但后来它不会显示。
我不能说,如果我失去了一些东西基本,或有还有一些关于UIAlertController我不知道的。
你为什么要引用rootViewController而不是执行操作的currentVC导致显示警报? – SeanLintern88
另外我相信消息必须在初始化程序中设置?它也很奇怪,你保留一个参考:/因为你得到所有你需要做的动作回调? – SeanLintern88
尝试显示警报并在 – ColdGrub1384