📜  uialertcontroller 示例目标 c - Objective-C 代码示例

📅  最后修改于: 2022-03-11 15:04:44.984000             🧑  作者: Mango

代码示例1
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
    message:@"This is an alert."
    preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
    handler:^(UIAlertAction * action) {}];

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