提示框
1 //初始化提示框; 2 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"按钮被点击了" preferredStyle: UIAlertControllerStyleAlert]; 3 4 [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 5 //点击按钮的响应事件; 6 }]]; 7 8 //弹出提示框; 9 [self presentViewController:alert animated:true completion:nil];