普通的提示框

2018-12-25  本文已影响0人  aggie1024

弹出提示框,点击确定取消提示框

  • (void)showError:(NSString *)errorMsg {
    // 1.弹框提醒
    // 初始化对话框
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"" message:errorMsg preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]];
    // 弹出对话框
    [self presentViewController:alert animated:true completion:nil];
    }

调用:

[self showError:@"内容根据需求来写啊"];

上一篇 下一篇

猜你喜欢

热点阅读