123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- //
- // PrefixHeader.pch
- // StudentDaya
- //
- // Created by Kyle on 2019/8/12.
- // Copyright © 2019 DayaMusic. All rights reserved.
- //
- #ifndef PrefixHeader_pch
- #define PrefixHeader_pch
- #import "Common.h"
- #import "UIColor+Hex.h"
- #import "MBProgressHUD+NJ.h"
- #import "UIViewController+zhStatusBarStyle.h"
- #import "pickBut.h"
- #import "NSDictionary+Extension.h"
- #import "NSString+MD5.h"
- #import "UIView+TZLayout.h"
- #import "UIImageView+WebCache.h"
- #import "Masonry.h"
- #import "MJRefresh.h"
- #import "KSNetworkingManager.h"
- #import "IQKeyboardManager.h"
- #import "UserKeyHeader.h"
- #import "UIView+ShowProgress.h"
- #import "UIControl+ButtonAction.h"
- #import "UIView+KSExtension.h"
- #import "Macro.h"
- #import "KSGifRefreshHeader.h"
- #import "KSGifRefreshFooter.h"
- #import "KSUploadManager.h"
- #import "UIView+SubViewExtension.h"
- #import "NSObject+KSDateFormatter.h"
- #import "KSLoginManager.h"
- #import "KSHudLoagingManager.h"
- #define FIRST_LOGIN_KEY (@"FirstLoginKey")
- #define DEALCALLBACKNOTICIFATION (@"DEALCALLBACKNOTICIFATION")
- // 加密使用 NSString+MD5
- #define DEFAULT_SALT (@"D5sIlPU2")
- #define APPSECRET (@"QuMCIKICAgIH0sCiAgICAicGxhdGZvcm0tZGV2IjogW10")
- #import "KSSafeObject.h"
- #define KSKitDispatchDownloadMediaNotification (@"KSKitDispatchDownloadMediaNotification")
- #define KObjNull (id)[NSNull null]
- #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
- #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
- //颜色定义
- #define Color_Macro(x, y, z, a) [UIColor colorWithRed:x*1.0f/255.0 green:y*1.0f/255.0 blue:z*1.0f/255.0 alpha:a*1.0f]
- #define DEFAULT_HEIGHT (40)
- #define KObjNull (id)[NSNull null]
- #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
- #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
- /**宽度比例*/
- #define HBJ_ScaleWidth(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
- /**高度比例*/
- #define HBJ_ScaleHeight(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.height/667)*(__VA_ARGS__)
- /**全局字体*/
- #define GlobelNormalFont(__VA_ARGS__) ([UIFont systemFontOfSize:HBJ_ScaleFont(__VA_ARGS__)])
- /**字体比例*/
- #define HBJ_ScaleFont(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
- #define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
- #define HexRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
- //设备屏幕尺寸
- #define kScreen_Height ([UIScreen mainScreen].bounds.size.height)
- #define kScreen_Width ([UIScreen mainScreen].bounds.size.width)
- #define kScreen_Frame (CGRectMake(0, 0 ,kScreen_Width,kScreen_Height))
- #define kScreen_CenterX kScreen_Width/2
- #define kScreen_CenterY kScreen_Height/2
- //应用尺寸(不包括状态栏,通话时状态栏高度不是20,所以需要知道具体尺寸)
- #define kContent_Height ([UIScreen mainScreen].applicationFrame.size.height)
- #define kContent_Width ([UIScreen mainScreen].applicationFrame.size.width)
- #define kContent_Frame (CGRectMake(0, 0 ,kContent_Width,kContent_Height))
- #define kContent_CenterX kContent_Width/2
- #define kContent_CenterY kContent_Height/2
- #define kWIDTH_RATE (375.0 / kScreen_Width)
- #define kHEIGHT_RATE (667.0 / kScreen_Height)
- // 防止多次调用
- #define kPreventRepeatClickTime(_seconds_) \
- static BOOL shouldPrevent; \
- if (shouldPrevent) return YES; \
- shouldPrevent = YES; \
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((_seconds_) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
- shouldPrevent = NO; \
- }); \
- #define dispatch_main_sync_safe(block)\
- if ([NSThread isMainThread]) {\
- block();\
- } else {\
- dispatch_sync(dispatch_get_main_queue(), block);\
- }
- //1. 测试且 ARC 环境
- #ifndef weakObj
- #define weakObj(object) autoreleasepool {} __weak __typeof__(object) object##_##weak_ = object;
- #endif
- #ifndef strongObj
- #define strongObj(object) autoreleasepool {} __typeof__(object) object = object##_##weak_;
- #endif
- //2. 正式且 ARC 环境
- #ifndef weakObj
- #define weakObj(object) try {} @catch (...){} __weak __typeof__(object) object##_##weak_ = object;
- #endif
- #ifndef strongObj
- #define strongObj(object) try {} @catch (...){} __typeof__(object) object = object##_##weak_;
- #endif
- // Include any system framework and library headers here that should be included in all compilation units.
- // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
- #import "KSDomain.h"
- #endif /* PrefixHeader_pch */
|