123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- //
- // RQShareFunction.h
- // LN_School
- //
- // Created by 张嵘 on 2018/10/16.
- // Copyright © 2018 Danson. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "UITextField+RQExtension.h"
- #import "LocalNotificationManager.h"
- #import "SLShotViewController.h"
- #define RQ_SHARE_FUNCTION [RQShareFunction shareManager]
- //获取图片方式
- typedef NS_ENUM(NSInteger, GetPhotosWay) {
- GetPhotosWay_Camera = 0,
- GetPhotosWay_Album,
- };
- typedef void(^PhotosBlock)(NSArray *imagesArr , NSArray * imagesDataStrArr);
- NS_ASSUME_NONNULL_BEGIN
- //弹窗点击事件回调
- typedef void (^RQAlertViewCompletion) (NSUInteger selectedOtherButtonIndex);
- @interface RQShareFunction : NSObject
- @property (strong, readwrite, nonatomic) NSArray *shieldTopicIDArr;
- @property (strong, readwrite, nonatomic) NSArray *shieldPeopleIDArr;
- @property (strong, readwrite, nonatomic) NSArray *announcementIDArr;
- @property (assign, readwrite, nonatomic) CGFloat RQADViewHeight;
- @property (assign, readwrite, nonatomic) NSInteger myErorNum;
- @property (assign, readwrite, nonatomic) NSInteger myCollectNum;
- + (instancetype)shareManager;
- // 时间转换为时间戳
- - (NSInteger)getTimeStampWithDate:(NSDate *)date;
- // 时间戳转换为时间
- - (NSDate *)getDateWithTimeStamp:(NSInteger)timeStamp;
- // 一个时间戳与当前时间的间隔(s)
- - (NSInteger)getIntervalsWithTimeStamp:(NSInteger)timeStamp;
- - (NSString *)getCurrentTimeString;
- - (NSString *)getCurrentTimeStringWithTimeStamp:(NSInteger)timeStamp;
- // 根据时间字符串和formatter获取时间戳(s)
- - (NSInteger)getTimeStampWithTimeStr:(NSString *)timeStr formatter:(NSString *)formatterStr;
- /**
- * 获取当前页面
- *
- * @author ZhangRong
- * @date 2018-10-17 10:59:22
- */
- - (UIViewController *)topViewController;
- - (UIViewController *)currentViewController;
- - (UIViewController *)topViewController:(UIViewController*)rootViewController;
- /**
- * 在某个页面展示弹窗
- *
- * @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:(nullable 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:(nullable 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:(nullable NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- completion:(nullable RQAlertViewCompletion)completion;
- - (void)showAlertAtViewController:(nonnull UIViewController *)viewController
- WithTitle:(nullable NSString *)title
- message:(nullable NSString *)message
- alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
- cancelButtonTitle:(nullable NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- preferredActionTitle:(nullable NSString *)preferredActionTitle
- showInWindow:(BOOL)showInWindow
- completion:(nullable RQAlertViewCompletion)completion;
- - (void)showAlertWithTitle:(nullable NSString *)title
- message:(nullable NSString *)message
- alertControllerStyle:(UIAlertControllerStyle)alertControllerStyle
- cancelButtonTitle:(nullable NSString *)cancelButtonTitle
- otherButtonTitles:(nullable NSArray *)otherButtonTitles
- otherButtonStyles:(nullable NSDictionary *)otherButtonStyles
- showInWindow:(BOOL)showInWindow
- completion:(nullable RQAlertViewCompletion)completion;
- /**
- * 展示大图
- *
- * @author ZhangRong
- * @date 2020-06-16 14:30:55
- *
- * @param dataSource 图片数组(Url数组)
- * @param currentIndex 当前标签
- * @param isCanSave 是否保存图片
- */
- - (void)showPhotoBrowserWithDataSource:(NSArray *)dataSource currentIndex:(NSInteger)currentIndex isCanSave:(BOOL)isCanSave;
- /**
- * Mob隐私判断
- *
- * @author ZhangRong
- * @date 2020-06-16 14:30:55
- */
- - (void)checkMobPolicyOnResult:(void (^_Nullable)(BOOL success))handler;
- /// 保存到本地数据
- /// @param object 值
- /// @param key 键
- - (void)saveObjectWithObject:(id)object ForKey:(NSString* )key;
- /// 获取本地数据
- /// @param key 键
- - (id)getObjectWithKey:(NSString *)key;
- // 检测抓包
- - (BOOL)checkProxySetting;
- // 前往H5
- - (void)gotoWebViewWithUrlStr:(NSString *)url;
- // 前往小程序
- - (void)miniwithUserName:(NSString *)userName path:(NSString *)path;
- /**
- * 获取图片
- *
- * @author ZhangRong
- * @date 2018-10-17 10:55:22
- *
- * @param getPhotosWay 获取图片方式
- * @param size 图片尺寸比例
- * @param maxLength 图片内存大小限制
- * @param maxImagesCount 最大图片选择
- * @param isCheckBody 是否是活体拍照
- * @param photosBlock 弹窗点击事件回调
- */
- - (void)getPhotosWithGetPhotosWay:(GetPhotosWay)getPhotosWay size:(CGSize)size maxLength:(NSUInteger)maxLength maxImagesCount:(NSUInteger)maxImagesCount isCheckBody:(BOOL)isCheckBody photosBlock:(PhotosBlock)photosBlock;
- @end
- NS_ASSUME_NONNULL_END
|