UIAlertController * cancleAlertController = [UIAlertController alertControllerWithTitle:nil message:@"你确定退出登录?" preferredStyle:UIAlertControllerStyleAlert];

    

//    第一种添加方法

    [cancleAlertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

        

        NSLog(@"点击取消");

        

    }]];

 

  //    第二种添加方法

    UIAlertAction * otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

        NSLog(@"点击确定");

        

    }];

    

    [cancleAlertController addAction:otherAction];

    //弹出视图

    [self presentViewController:cancleAlertController animated:YES completion:nil];

相关文章:

  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
相关资源
相似解决方案