1,取消、确定
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"你确定删除该消息?" preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
Log(@"确定");
}]];
[self presentViewController:alertController animated:YES completion:nil];
2.弹出框
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"哈哈消息" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];