Swift 之 UIAlertController

2016-12-25  本文已影响49人  乡水情缘

下面以清空缓存简单记录一下UIAlertController 的使用

 let alert = UIAlertController(title: "清除缓存", message: "", preferredStyle: UIAlertControllerStyle.alert);
            let alertConfirm = UIAlertAction(title: "确定", style: UIAlertActionStyle.default) { (alertConfirm) -> Void in
                XPToast.show(withText: "清除成功");
             }
            alert.addAction(alertConfirm)
            let cancle = UIAlertAction(title: "取消", style: UIAlertActionStyle.cancel) { (cancle) -> Void in
                
            }
            alert.addAction(cancle)
            // 提示框弹出
           self.present(alert, animated: true) { () -> Void in
                
            }
上一篇 下一篇

猜你喜欢

热点阅读