swift3.0UIAlertController使用方法

来源:互联网 发布:vm数据区 编辑:程序博客网 时间:2024/06/05 07:25

 let alertVC :UIAlertController = UIAlertController.init(title:"添加照片", message: "", preferredStyle: .actionSheet)

        let cleanAction =UIAlertAction(title: "取消", style: UIAlertActionStyle.cancel,handler:nil)

        let photoAction =UIAlertAction(title: "拍照", style: UIAlertActionStyle.default){ (action:UIAlertAction)in

            

            //填写需要的响应方法

            

        }

        let choseAction =UIAlertAction(title: "从手机相册选择", style: UIAlertActionStyle.default){ (action:UIAlertAction)in

            

            //填写需要的响应方法

            

        }

        alertVC.addAction(cleanAction)

        alertVC.addAction(photoAction)

        alertVC.addAction(choseAction)

        self.present(alertVC, animated:true, completion: nil)

0 0
原创粉丝点击