关于创建iOS多个选项的弹出框

关于创建iOS多个选项的弹出框

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"请选择新增方式" message:@"" preferredStyle:UIAlertControllerStyleAlert]

// 添加按钮

    __weaktypeof(alert) weakAlert = alert;

    [alertaddAction:[UIAlertAction actionWithTitle:@"新增陈列" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {

        NSLog(@"点击了确定按钮--%@-%@", [weakAlert.textFields.firstObjecttext], [weakAlert.textFields.lastObjecttext]);

    }]];

[alertaddAction:[UIAlertAction actionWithTitle:@"扫描新增" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

        NSLog(@"点击了取消按钮");

    }]];

    [alertaddAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

        NSLog(@"点击了其它按钮");

    }]];

    [self presentViewController:alert animated:YES completion:nil];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容