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