FanweMessage.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //
  2. // FanweMessage.h
  3. // BuguLive
  4. //
  5. // Created by xfg on 16/2/15.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <Foundation/Foundation.h>
  10. #import "MMAlertView.h"
  11. /**
  12. 弹出框类型
  13. - FanweMessageTypeAlertOneBtn: 一个按钮的弹框
  14. - FanweMessageTypeAlertTwoBtn: 两个按钮的弹框
  15. - FanweMessageTypeInputAlertTwoBtn: 两个按钮的带输入框的弹框
  16. - FanweMessageTypeSheet: Sheet类型弹框
  17. - FanweMessageTypeHud: HUD类型弹框(无按钮)
  18. - FanweMessageTypeTWMessageBar: TWMessageBar类型弹框(无按钮)
  19. - FanweMessageTypeCustom: 自定义弹框
  20. */
  21. typedef NS_ENUM(NSUInteger, FanweMessageType)
  22. {
  23. FanweMessageTypeAlertOneBtn,
  24. FanweMessageTypeAlertTwoBtn,
  25. FanweMessageTypeInputAlertTwoBtn,
  26. FanweMessageTypeSheet,
  27. FanweMessageTypeHud,
  28. FanweMessageTypeTWMessageBar,
  29. FanweMessageTypeCustom,
  30. };
  31. @interface FanweMessage : NSObject
  32. #pragma mark - ----------------------- 一个按钮的弹框 -----------------------
  33. /**
  34. 消息提示框:“知道了”
  35. @param message 提示框显示内容,默认标题“温馨提示”
  36. @return MMAlertView
  37. */
  38. + (MMAlertView *)alert:(NSString *)message;
  39. /**
  40. 消息提示框:“知道了”
  41. @param title 标题,当title长度为0或者title为nil时不显示默认标题“温馨提示”
  42. @param message 提示框显示内容
  43. @param isHideTitle 是否隐藏默认标题
  44. @param destructiveAction 点击“知道了”回调
  45. @return MMAlertView
  46. */
  47. + (MMAlertView *)alert:(NSString *)title message:(NSString *)message isHideTitle:(BOOL)isHideTitle destructiveAction:(FWVoidBlock)destructiveAction;
  48. /**
  49. 消息提示框:“知道了”
  50. @param title 标题,当title长度为0或者title为nil时不显示默认标题“温馨提示”
  51. @param message 提示框显示内容
  52. @param isHideTitle 是否隐藏默认标题
  53. @param destructiveTitle “知道了”按钮重命名
  54. @param destructiveAction 点击“知道了”回调
  55. @return MMAlertView
  56. */
  57. + (MMAlertView *)alert:(NSString *)title message:(NSString *)message isHideTitle:(BOOL)isHideTitle destructiveTitle:(NSString *)destructiveTitle destructiveAction:(FWVoidBlock)destructiveAction;
  58. #pragma mark - ----------------------- 两个按钮的弹框 -----------------------
  59. /**
  60. 消息提示框:“确定”、“取消”
  61. @param title 标题,当title长度为0或者title为nil时不显示默认标题“温馨提示”
  62. @param message 提示框显示内容
  63. @param destructiveAction 确定回调
  64. @param cancelAction 取消回调
  65. @return MMAlertView
  66. */
  67. + (MMAlertView *)alert:(NSString *)title message:(NSString *)message destructiveAction:(FWVoidBlock)destructiveAction cancelAction:(FWVoidBlock)cancelAction;
  68. /**
  69. 消息提示框:“确定”、“取消”
  70. @param title 标题,当title长度为0或者title为nil时不显示默认标题“温馨提示”
  71. @param message 提示框显示内容
  72. @param destructiveTitle “确定”按钮名称
  73. @param destructiveAction 确定回调
  74. @param cancelTitle “取消”按钮名称
  75. @param cancelAction 取消回调
  76. @return MMAlertView
  77. */
  78. + (MMAlertView *)alert:(NSString *)title message:(NSString *)message destructiveTitle:(NSString *)destructiveTitle destructiveAction:(FWVoidBlock)destructiveAction cancelTitle:(NSString *)cancelTitle cancelAction:(FWVoidBlock)cancelAction;
  79. /**
  80. 消息提示框:“确定”、“取消”(UIAlertController),暂不推荐使用
  81. @param message 提示框显示内容
  82. @param viewController 在viewController中显示,如果viewController传nil则默认用当前window的rootViewController
  83. @return UIAlertController
  84. */
  85. + (UIAlertController *)alertController:(NSString *)message viewController:(UIViewController *)viewController;
  86. /**
  87. 消息提示框:“确定”、“取消”(UIAlertController),暂不推荐使用
  88. @param message 提示框显示内容
  89. @param viewController 在viewController中显示,如果viewController传nil则默认用当前window的rootViewController
  90. @param destructiveAction 确定,传nil则不添加确定按钮
  91. @param cancelAction 取消,传nil则不添加取消按钮
  92. @return UIAlertController
  93. */
  94. + (UIAlertController *)alertController:(NSString *)message viewController:(UIViewController *)viewController destructiveAction:(FWVoidBlock)destructiveAction cancelAction:(FWVoidBlock)cancelAction;
  95. #pragma mark - ----------------------- 两个按钮的带输入框的弹框 -----------------------
  96. /**
  97. 消息提示框:带输入框,“确定”、“取消”
  98. @param title 标题,当title长度为0或者title为nil时不显示默认标题“温馨提示”
  99. @param message 提示框显示内容
  100. @param placeholder 输入框的默认显示
  101. @param keyboardType 键盘类型
  102. @param destructiveTitle “确定”按钮名称
  103. @param destructiveAction 确定回调
  104. @param cancelTitle “取消”按钮名称
  105. @param cancelAction 取消回调
  106. @return MMAlertView
  107. */
  108. + (MMAlertView *)alertInput:(NSString *)title message:(NSString *)message placeholder:(NSString *)placeholder keyboardType:(UIKeyboardType)keyboardType destructiveTitle:(NSString *)destructiveTitle destructiveAction:(MMPopupInputHandler)destructiveAction cancelTitle:(NSString *)cancelTitle cancelAction:(FWVoidBlock)cancelAction;
  109. #pragma mark - ----------------------- HUD类型弹框(无按钮) -----------------------
  110. /**
  111. 消息提示框:HUD
  112. @param message 提示框显示内容
  113. */
  114. + (void)alertHUD:(NSString *)message;
  115. /**
  116. 消息提示框:HUD
  117. @param message 提示框显示内容
  118. @param seconds 显示时长
  119. */
  120. + (void)alertHUD:(NSString *)message delay:(CGFloat)seconds;
  121. #pragma mark - ----------------------- TWMessageBar类型弹框(无按钮) -----------------------
  122. /**
  123. 消息提示框:TWMessageBarManager
  124. @param message 提示框显示内容
  125. */
  126. + (void)alertTWMessage:(NSString *)message;
  127. @end