【发布时间】:2017-10-30 05:52:35
【问题描述】:
我尝试在我的应用委托中创建弹出警报消息,但它根本没有显示。程序是用 Swift 4 编写的。
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let alert = UIAlertController(title: "title", message: "message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.window?.rootViewController?.present(alert, animated: true, completion: nil)
}
【问题讨论】:
标签: ios swift appdelegate uialertcontroller