# AlertViewController **Repository Path**: huatian001/AlertViewController ## Basic Information - **Project Name**: AlertViewController - **Description**: 自定义弹出提示框 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2016-10-31 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #AlertViewController * 简单使用方式 * 首先引入头文件 ```objc #import "PBAlertController.h" ``` * 获取单例类,在需要弹出提示框的方法内部写如下代码 ```objc PBAlertController * alertVc = [PBAlertController shareAlertController]; [alertVc alertViewControllerWithMessage:@"这是一message沙哈" andBlock:^{ NSLog(@"点击确定后执行的方法"); }]; alertVc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:alertVc animated:YES]; ``` * 利用获取的单例来设置alertView的各种属性 ```objc /** 设置alertView背景色 */ @property (nonatomic, copy) UIColor *alertBackgroundColor; /** 设置确定按钮背景色 */ @property (nonatomic, copy) UIColor *btnConfirmBackgroundColor; /** 设置取消按钮背景色 */ @property (nonatomic, copy) UIColor *btnCancelBackgroundColor; /** 设置message字体颜色 */ @property (nonatomic, copy) UIColor *messageColor; ``` * 把demo里面的PBAlertViewController文件夹直接拖到项目中即可.