iOS弹窗UIAlertAction用法

 1 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"确认" message:@"确认删除吗?" preferredStyle:UIAlertControllerStyleAlert];
 2     
 3     UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
 4         //取消处理
 5     }];
 6     
 7     UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
 8         //确认处理
 9     }];
10     
11     [alert addAction:action1];
12     [alert addAction:action2];
13     [self.navigationController presentViewController:alert animated:YES completion:nil];

 

posted @ 2019-10-15 18:36  洛洛沙  阅读(5929)  评论(0)    收藏  举报