首页 > 其他 > 详细

Summarize code for the three presentation experiments

时间:2015-08-15 21:20:27      阅读:204      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!