Alter或ActionSheet

来源:互联网 发布:淘宝企业店铺能撤销吗 编辑:程序博客网 时间:2024/06/01 07:25

xcode 提示只前用的alter过期了,之后自己在系统原生的方法上进行封装了一下。
使用方法很简单 直接上代码,希望能帮到大家谢谢!

- (void)viewDidLoad {    [super viewDidLoad];    __weak ViewController *ws = self;    [SLAlertVC showVC:self message:@"第一个"];    [SLAlertVC showVC:self              message:@"第二个"           confirmBtn:@"确定"       handle_confirm:^(UIAlertAction *action) {           ws.view.backgroundColor = [UIColor redColor];    }];    [SLAlertVC showVC:self     preferredStyle:UIAlertControllerStyleActionSheet              message:@"测试"           confirmBtn:@"确定"            cancelBtn:@"取消"       handle_confirm:^(UIAlertAction *action) {           [SLAlertVC showVC:ws message:@"第三个测试,确定"];    } handle_cancel:^(UIAlertAction *action) {        [SLAlertVC showVC:ws message:@"第三个测试,取消"];    }];    [SLAlertVC showVC:self       preferredStyle:(UIAlertControllerStyleActionSheet)              message:@"第四个"           confirmBtn:@"扫一扫"            cancelBtn:@"取消"       handle_confirm:^(UIAlertAction *action) {        [ws.navigationController pushViewController:[ScanCodeVC alloc] animated:YES];    } handle_cancel:^(UIAlertAction *action) {        [SLAlertVC showVC:ws message:@"第四个测试,取消"];    }];}

完整的工程在去https://github.com/Victory886/textDemo 下载
git 里也有一个二维码扫描是跟这一起的。

0 0