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

Summarize code for the three presentation experiments

时间:2015-08-15 21:23:05      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:

Image Picker Controller

@IBAction func experiment() {
    let controller = UIImagePickerController()        
    self.presentViewController(controller, animated: true, completion: nil)
}

Activity View Controller

   
@IBAction func experiment() {
    let image = UIImage()
    let controller = UIActivityViewController(activityItems: [image], applicationActivities: nil) 
    self.presentViewController(controller, animated: true, completion: nil)
}

Alert View Controller

@IBAction func experiment() {
    let controller = UIAlertController()
    controller.title = "Test alert"
    controller.message = "This is a test"

    // Dismiss the view controller after the user taps “ok”    
    let okAction = UIAlertAction (title:"ok", style: UIAlertActionStyle.Default) {
        action in self.dismissViewControllerAnimated(true, completion: nil)
    }
    controller.addAction(okAction) 
    self.presentViewController(controller, animated: true, completion:nil)
}

Summarize code for the three presentation experiments

标签:

原文地址:http://www.cnblogs.com/dagon/p/4733105.html

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