RQShareFunction.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //
  2. // RQShareFunction.h
  3. // LN_School
  4. //
  5. // Created by 张嵘 on 2018/10/16.
  6. // Copyright © 2018 Danson. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #define RQ_SHARE_FUNCTION [RQShareFunction shareManager]
  10. NS_ASSUME_NONNULL_BEGIN
  11. //弹窗点击事件回调
  12. typedef void (^RQAlertViewCompletion) (NSUInteger selectedOtherButtonIndex);
  13. //获取图片方式
  14. typedef NS_ENUM(NSInteger, GetPhotosWay) {
  15. GetPhotosWay_Camera = 0,
  16. GetPhotosWay_Album,
  17. };
  18. typedef void(^PhotosBlock)(NSArray *imagesArr , NSArray * imagesDataStrArr);
  19. @interface RQShareFunction : NSObject
  20. + (instancetype)shareManager;
  21. /**
  22. * 获取图片
  23. *
  24. * @author ZhangRong
  25. * @date 2018-10-17 10:55:22
  26. *
  27. * @param getPhotosWay 获取图片方式
  28. * @param size 图片尺寸比例
  29. * @param maxLength 图片内存大小限制
  30. * @param maxImagesCount 最大图片选择
  31. * @param photosBlock 弹窗点击事件回调
  32. */
  33. - (void)getPhotosWithGetPhotosWay:(GetPhotosWay)getPhotosWay size:(CGSize)size maxLength:(NSUInteger)maxLength maxImagesCount:(NSUInteger)maxImagesCount photosBlock:(PhotosBlock)photosBlock;
  34. /**
  35. * 获取当前页面
  36. *
  37. * @author ZhangRong
  38. * @date 2018-10-17 10:59:22
  39. */
  40. - (UIViewController *)getCurrentVC;
  41. /**
  42. * 在某个页面展示弹窗
  43. *
  44. * @author ZhangRong
  45. * @date 2018-10-12 11:27:55
  46. *
  47. * @param viewController 在该页面弹出
  48. * @param title 标题
  49. * @param message 副标题(可为nil)
  50. * @param alertControllerStyle 弹窗类型
  51. * @param cancelButtonTitle 取消按钮标题
  52. * @param otherButtonTitles 按钮标题数组
  53. * @param otherButtonStyles 按钮类型数组
  54. * @param preferredActionTitle 按钮文字加粗数组(UIAlertControllerStyleAlert有效)
  55. * @param completion 按钮点击回调
  56. */
  57. - (void)showAlertAtViewController:(nonnull UIViewController *)viewController
  58. WithTitle:(nullable NSString *)title
  59. message:(nullable NSString *)message
  60. alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
  61. cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
  62. otherButtonTitles:(nullable NSArray *)otherButtonTitles
  63. otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
  64. preferredActionTitle:(nullable NSString *)preferredActionTitle
  65. completion:(nullable RQAlertViewCompletion)completion;
  66. /**
  67. * 展示弹窗(设置按钮文字加粗)
  68. *
  69. * @author ZhangRong
  70. * @date 2018-10-12 11:27:55
  71. *
  72. * @param title 标题
  73. * @param message 副标题(可为nil)
  74. * @param alertControllerStyle 弹窗类型
  75. * @param cancelButtonTitle 取消按钮标题
  76. * @param otherButtonTitles 按钮标题数组
  77. * @param otherButtonStyles 按钮类型数组
  78. * @param preferredActionTitle 按钮文字加粗数组(UIAlertControllerStyleAlert有效)
  79. * @param completion 按钮点击回调
  80. */
  81. - (void)showAlertWithTitle:(nullable NSString *)title
  82. message:(nullable NSString *)message
  83. alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
  84. cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
  85. otherButtonTitles:(nullable NSArray *)otherButtonTitles
  86. otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
  87. preferredActionTitle:(nullable NSString *)preferredActionTitle
  88. completion:(nullable RQAlertViewCompletion)completion;
  89. /**
  90. * 展示弹窗
  91. *
  92. * @author ZhangRong
  93. * @date 2018-10-12 11:27:55
  94. *
  95. * @param title 标题
  96. * @param message 副标题(可为nil)
  97. * @param alertControllerStyle 弹窗类型
  98. * @param cancelButtonTitle 取消按钮标题
  99. * @param otherButtonTitles 按钮标题数组
  100. * @param otherButtonStyles 按钮类型数组
  101. * @param completion 按钮点击回调
  102. */
  103. - (void)showAlertWithTitle:(nullable NSString *)title
  104. message:(nullable NSString *)message
  105. alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
  106. cancelButtonTitle:(nonnull NSString *)cancelButtonTitle
  107. otherButtonTitles:(nullable NSArray *)otherButtonTitles
  108. otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
  109. completion:(nullable RQAlertViewCompletion)completion;
  110. @end
  111. NS_ASSUME_NONNULL_END