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];

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM