模仿微信的alertSheet 调用方法可官方UIAlertController一模一样
查看次数:2174
下载次数:398
上传时间:2016-11-21
大小:221 B
使用方法和官方一样 模态出一个新的视图控制器 使用的时候直接导入头文件#import "CLAlertController.h"
调用方法如下
CLAlertController *alert = [CLAlertController alertControllerWithTitle:@"更改头像" message:@"选择方式如下:各种小魔头这是一个AlertController 用来学习用的这是一个AlertController 用来学习用的这是一个AlertController 用来学习用的" preferredStyle:CLAlertControllerStyleSheet];
[alert addAction:[CLAlertModel actionWithTitle:@"打开相机" style:CLAlertActionStyleDefault handler:^(CLAlertModel *action) {
}]];
[alert addAction:[CLAlertModel actionWithTitle:@"保存照片" style:CLAlertActionStyleDefault handler:^(CLAlertModel *action) {
}]];
[alert addAction:[CLAlertModel actionWithTitle:@"打开相册" style:CLAlertActionStyleDestructive handler:^(CLAlertModel *action) {
}]];
[alert addAction:[CLAlertModel actionWithTitle:@"取消" style:CLAlertActionStyleCancel handler:^(CLAlertModel *action) {
}]];
[self presentToViewController:alert completion:nil];
收藏