//对话框控制器
let alertController = UIAlertController(title: "提示", message: "数字不能为空", preferredStyle: UIAlertControllerStyle.Alert)
//点击按钮动作
let canCelAction = UIAlertAction(title: "取消", style: UIAlertActionStyle.Cancel, handler: { (UIAlertAction) -> Void in
print("取消操作")
})
let okAction = UIAlertAction(title: "确定", style: UIAlertActionStyle.Default, handler:nil)
alertController.addAction(canCelAction)
alertController.addAction(okAction)
self.presentViewController(alertController, animated:true, completion:nil)
Swift下弹出对话框
最新推荐文章于 2023-02-15 10:10:35 发布