- UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示"
- message:@"是否要重新开始?"
- preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"是" style:UIAlertActionStyleDefault
- handler:^(UIAlertAction * action) {
- self.timeLabel.text = @"5";
- }];
- UIAlertAction* Action1 = [UIAlertAction actionWithTitle:@"取消"
- style:UIAlertActionStyleCancel
- handler:^(UIAlertAction *action) {
- }];
- [alert addAction:defaultAction];
- [alert addAction:Action1];
- [self presentViewController:alert animated:YES completion:nil];
alertDialog示例
最新推荐文章于 2020-05-22 17:23:12 发布