尝试使用
self.window?.rootViewController?.presentViewController(importAlert, animated: true, completion: nil)
您只需要一个viewController
对象即可显示AlertController。
在Swift 4中:
self.window?.rootViewController?.present(importAlert, animated: true, completion: nil)
简单的App Delegate方法来显示UIAlertController(在Swift中)
尝试使用
self.window?.rootViewController?.presentViewController(importAlert, animated: true, completion: nil)
您只需要一个viewController
对象即可显示AlertController。
在Swift 4中:
self.window?.rootViewController?.present(importAlert, animated: true, completion: nil)