WMZAlert.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // WMZAlert.h
  3. // WMZAlert
  4. //
  5. // Created by wmz on 2018/10/9.
  6. // Copyright © 2018年 wmz. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef void (^NavClickBlock)(id anyID);
  10. typedef enum : NSUInteger {
  11. AlertTypeNornal = 0, //默认弹窗
  12. AlertTypeAuto = 1, //默认弹窗自动消失
  13. AlertTypeSystemPush = 2, //系统弹窗
  14. AlertTypeSystemSheet = 3, //系统底部弹窗
  15. AlertTypePay = 4, //支付密码框
  16. AlertTypeToast = 5, //顶部显示弹窗
  17. AlertTypeWrite = 6, //带编辑框的弹窗
  18. AlertTypeTime = 7, //带倒计时的弹窗
  19. AlertTypeSelect = 8, //带选择的弹窗
  20. AlertTypeShare = 9 //带分享的弹窗
  21. } AlertType;
  22. @interface WMZAlert : UIViewController
  23. /*
  24. * 初始化
  25. */
  26. + (instancetype)shareInstance;
  27. /*
  28. * 简单化弹窗没有回调
  29. *
  30. * @param AlertType 弹窗类型
  31. * @param text 显示内容
  32. *
  33. */
  34. - (void)showAlertWithType:(AlertType)type
  35. textTitle:(id)text;
  36. /*
  37. * 简单化弹窗带回调
  38. *
  39. * @param AlertType 弹窗类型
  40. * @param title 标题内容
  41. * @param text 显示内容
  42. * @param leftBlock 取消按钮点击回调
  43. * @param rightBlock 确定按钮点击回调
  44. *
  45. */
  46. - (void)showAlertWithType:(AlertType)type
  47. headTitle:(NSString*)title
  48. textTitle:(id)text
  49. leftHandle:(NavClickBlock)leftBlock
  50. rightHandle:(NavClickBlock)rightBlock;
  51. /*
  52. * 最全面弹窗可以设置按钮颜色等
  53. *
  54. * @param AlertType 弹窗类型
  55. * @param VC 显示的VC
  56. * @param leftText 取消按钮文字内容
  57. * @param rightText 确定按钮文字内容
  58. * @param title 标题内容
  59. * @param text 显示内容
  60. * @param titleColor 标题内容颜色
  61. * @param textColor 显示内容颜色
  62. * @param backColor 背景颜色
  63. * @param okColor 确定按钮文字颜色
  64. * @param cancelColor 取消按钮文字颜色
  65. * @param leftBlock 取消按钮点击回调
  66. * @param rightBlock 确定按钮点击回调
  67. *
  68. */
  69. - (void)showAlertWithType:(AlertType)type
  70. sueprVC:(UIViewController*)VC
  71. leftTitle:(NSString*)leftText
  72. rightTitle:(NSString*)rightText
  73. headTitle:(NSString*)title
  74. textTitle:(id)text
  75. headTitleColor:(UIColor*)titleColor
  76. textTitleColor:(UIColor*)textColor
  77. backColor:(UIColor*)backColor
  78. okBtnColor:(UIColor*)okColor
  79. cancelBtnColor:(UIColor*)cancelColor
  80. leftHandle:(NavClickBlock)leftBlock
  81. rightHandle:(NavClickBlock)rightBlock;
  82. @end