CustomActionAlertController.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // CustomActionAlertController.h
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2020/1/13.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface CustomActionAlertController : UIViewController
  11. /// 自定义弹窗
  12. /// @param title 标题
  13. /// @param message 内容
  14. /// @param sure 确认按钮 带有背景
  15. /// @param cancel 取消按钮
  16. /// @param block 回调 取消按钮index是0 确定按钮index是1
  17. - (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message sure:(nullable NSString *)sure cancel:(nullable NSString *)cancel selctedBlock:(void(^)(NSInteger index, NSString *title))block;
  18. - (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message sure:(nullable NSString *)sure cancel:(nullable NSString *)cancel selctedBlock:(void(^)(NSInteger index, NSString *title))block andCancelFullScreenTapGes:(BOOL )state;
  19. - (void)setupSureButtonBackgroundImage:(UIImage *)image;
  20. - (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message sure:(nullable NSString *)sure cancel:(nullable NSString *)cancel selctedBlock:(void(^)(NSInteger index, NSString *title))block andMuitipleLine:(BOOL )muitipleLine;
  21. /// 全屏显示,添加到windown上 建议使用此方法
  22. - (void)show;
  23. /// 显示到指定控制器上
  24. /// @param vc 父控制器不一定全屏
  25. - (void)showWithController:(UIViewController *)vc;
  26. - (void)dismiss;
  27. @end
  28. NS_ASSUME_NONNULL_END