提示框

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];

 

posted @ 2016-09-13 17:56  战神在路上  阅读(141)  评论(0编辑  收藏  举报