码迷,mamicode.com
首页 > 其他好文 > 详细

UIAlertController的写法

时间:2014-10-08 11:17:15      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:ios   uialertcontroller   

UIAlertController的写法

by 伍雪颖

@IBAction func showAlert(sender: AnyObject) {
        let alertController = UIAlertController(title: "Default Style", message: "A standard alert.", preferredStyle: .Alert)
       
        let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
            
        }
        alertController.addAction(cancelAction)
       
        let destroyAction = UIAlertAction(title: "Destroy", style: .Destructive) { (action) in
            println(action)
        }
        alertController.addAction(destroyAction)
       
        let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
            
        }
        alertController.addAction(OKAction)
       
        self.presentViewController(alertController, animated: true) {
            
        }
    }


UIAlertController的写法

标签:ios   uialertcontroller   

原文地址:http://blog.csdn.net/rainlesvio/article/details/39889509

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!