12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- //
- // RQAlertController.h
- // LN_School
- //
- // Created by 张嵘 on 2018/10/12.
- // Copyright © 2018 Danson. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- NS_ASSUME_NONNULL_BEGIN
- typedef void (^AlertActionBlock) (UIAlertAction * _Nonnull action);
- typedef void (^RQAlertViewCompletion) (NSUInteger selectedOtherButtonIndex);
- @interface RQAlertController : UIAlertController
- /**
- * 在某个页面展示弹窗
- *
- * @author ZhangRong
- * @date 2018-10-12 11:27:55
- *
- * @param viewController 在该页面弹出
- * @param title 标题
- * @param message 副标题(可为nil)
- * @param alertControllerStyle 弹窗类型
- * @param cancelButtonTitle 取消按钮标题
- * @param otherButtonTitles 按钮标题数组
- * @param otherButtonStyles 按钮类型数组
- * @param preferredActionTitle 按钮文字加粗数组(UIAlertControllerStyleAlert有效)
- * @param completion 按钮点击回调
- */
- + (void)showAlertAtViewController:(nonnull UIViewController *)viewController
- WithTitle:(nullable NSString *)title
- message:(nullable NSString *)message
- alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
- cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- preferredActionTitle:(nullable NSString *)preferredActionTitle
- completion:(nullable RQAlertViewCompletion)completion;
- /**
- * 展示弹窗(设置按钮文字加粗)
- *
- * @author ZhangRong
- * @date 2018-10-12 11:27:55
- *
- * @param title 标题
- * @param message 副标题(可为nil)
- * @param alertControllerStyle 弹窗类型
- * @param cancelButtonTitle 取消按钮标题
- * @param otherButtonTitles 按钮标题数组
- * @param otherButtonStyles 按钮类型数组
- * @param preferredActionTitle 按钮文字加粗数组(UIAlertControllerStyleAlert有效)
- * @param completion 按钮点击回调
- */
- + (void)showAlertWithTitle:(nullable NSString *)title
- message:(nullable NSString *)message
- alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
- cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- preferredActionTitle:(nullable NSString *)preferredActionTitle
- completion:(nullable RQAlertViewCompletion)completion;
- /**
- * 展示弹窗
- *
- * @author ZhangRong
- * @date 2018-10-12 11:27:55
- *
- * @param title 标题
- * @param message 副标题(可为nil)
- * @param alertControllerStyle 弹窗类型
- * @param cancelButtonTitle 取消按钮标题
- * @param otherButtonTitles 按钮标题数组
- * @param otherButtonStyles 按钮类型数组
- * @param completion 按钮点击回调
- */
- + (void)showAlertWithTitle:(nullable NSString *)title
- message:(nullable NSString *)message
- alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
- cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- completion:(nullable RQAlertViewCompletion)completion;
- @end
- NS_ASSUME_NONNULL_END
|