let alertController =UIAlertController(title: "温馨提示",
message:"你有一条消息", preferredStyle: .alert)
let okAction =UIAlertAction(title: "查看", style: .default, handler: {
action in
print("点击了确定")
})
alertController.addAction(okAction)
UIApplication.shared.keyWindow?.rootViewController?.present(alertController, animated: true, completion: nil)