Summarize code for the three presentation experiments
2015-08-15 21:07
357 查看
Image Picker Controller
Activity View Controller
Alert View 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) }
相关文章推荐
- 使用链路聚合进行负载分担
- 黑马程序员——Java基础03
- HDU 4450 Draw Something
- 欧拉路AND欧拉回路
- hdu 2814
- bootstrap轮播和百叶窗
- JS/PHP 浮点数精确运算
- Cocos2dx——瓦片地图(Tiled Map)
- BestCoder Round #51 (div.2) 1001 找规律+判素数
- Light 1008
- NSDate的使用方法
- 《數據結構與算法分析:C語言描述》習題2.11代碼及自己的想法
- MFC学习笔记
- 更改eclipse的编辑器样式风格
- 西安Uber优步司机奖励政策(8月10日到8月16日)
- 更改eclipse的编辑器样式风格
- JAVA基础(一)
- 一个字符为0~9的字符串转换成整型数组中数值的对应的形式
- windows 组策略编辑器不能打开 mmc无法创建管理单元
- Improving Multiview Face Detection with Multi-Task Deep Convolutional Neural Networks 基于深度学习的人脸检测算法