swift3.0UIAlertController使用方法

news/2024/7/5 1:54:53

 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)


http://lihuaxi.xjx100.cn/news/235246.html

相关文章

Linux下Shell日期的格式

2019独角兽企业重金招聘Python工程师标准>>> 不管是哪种语言,日期/时间都是一个非常重要的值。比如我们保存日志的时候,往往是某个前缀再加上当前时间,这样日志文件名称就可以做到唯一。在Shell环境里,我们获取时间的命…

视频录制+压缩+合并+清除沙盒缓存

-(void)AVCaptureVideo{ //创建视频设备(摄像头前,后) NSArray *devices [AVCaptureDevicedevicesWithMediaType:AVMediaTypeVideo]; //初始化一个摄像头输入设备(first是后置摄像头,last是前置摄像头) AVCaptureDeviceInput *inputVideo [AVCaptureDe…

长连接及在Node中的应用——HTTP/1.1 keep-alive

HTTP请求都要经过TCP三次握手建立连接,四次分手断开连,如果每个HTTP请求都要建立TCP连接的话是极其费时的,因此HTTP/1.1中浏览器默认开启了Connection: keep-alive。 请求头中的这个属性的作用可以在请求完成后,保持TCP连接一段时…

iOS使用Charts框架绘制—饼状图

作者:jianshu_wl 原文地址:http://www.jianshu.com/p/45194d861b21 首先先看一下效果: 一、创建饼状图对象 创建饼状图对象用到类是PieChartView.h, 代码如下: self.pieChartView [[PieChartView alloc] init]; self.pieChartView.backgroundColor Bg…

iOS封装HTTPS双向和单向验证

1.HttpsUtil (1) 对双向和单向验证的封装 #import <Foundation/Foundation.h> #import "AFNetworking.h" interface HttpsUtil : NSObject // 双向认证 (void)configHTTPSessionManager:(AFHTTPSessionManager *)manager serverCers:(NSArray *) serverCerNam…

乐视云计算被列入失信名单;三星华为达成和解;Python3 采用率超 84%丨Q新闻

本周要闻&#xff1a;三星华为达成和解&#xff1b;乐视云计算被列入失信名单&#xff1b;小米宣布成立技术委员会&#xff1b;支付宝小程序向个人开发者开放公测&#xff1b;Flutter 1.2 发布&#xff1b;Python3 采用率超 84%&#xff1b;调查称最受雇主欢迎的语言是 Go&…

做一款仿映客的直播App?看我就够了

来源&#xff1a;JIAAIR 链接&#xff1a;http://www.jianshu.com/p/5b1341e97757 一、直播现状简介 1.技术实现层面&#xff1a; 技术相对都比较成熟&#xff0c;设备也都支持硬编码。IOS还提供现成的 Video ToolBox框架&#xff0c;可以对摄像头和流媒体数据结构进行处理&am…

OC封装时间选择器

#import <UIKit/UIKit.h> protocol TimeDatePickerViewDelegate <NSObject> //必须实现的两个协议 required - (void)changeTime : (NSDate *)date;//当时改变时出发 - (void)daterMine : (NSDate *)date;//更确定时间 end interface TimeDatePickerView :UIView /…