PrefixHeader.pch 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // PrefixHeader.pch
  3. // StudentDaya
  4. //
  5. // Created by Kyle on 2019/8/12.
  6. // Copyright © 2019 DayaMusic. All rights reserved.
  7. //
  8. #ifndef PrefixHeader_pch
  9. #define PrefixHeader_pch
  10. #import "Common.h"
  11. #import "UIColor+Hex.h"
  12. #import "MBProgressHUD+NJ.h"
  13. #import "UIViewController+zhStatusBarStyle.h"
  14. #import "pickBut.h"
  15. #import "NSDictionary+Extension.h"
  16. #import "NSString+MD5.h"
  17. #import "UIView+TZLayout.h"
  18. #import "UIImageView+WebCache.h"
  19. #import "Masonry.h"
  20. #import "MJRefresh.h"
  21. #import "KSNetworkingManager.h"
  22. #import "IQKeyboardManager.h"
  23. #import "UserKeyHeader.h"
  24. #import "UIView+ShowProgress.h"
  25. #import "UIControl+ButtonAction.h"
  26. #import "UIView+KSExtension.h"
  27. #import "Macro.h"
  28. #import "KSGifRefreshHeader.h"
  29. #import "KSGifRefreshFooter.h"
  30. #import "KSUploadManager.h"
  31. #import "UIView+SubViewExtension.h"
  32. #import "NSObject+KSDateFormatter.h"
  33. #import "KSLoginManager.h"
  34. #import "KSHudLoagingManager.h"
  35. #define FIRST_LOGIN_KEY (@"FirstLoginKey")
  36. #define DEALCALLBACKNOTICIFATION (@"DEALCALLBACKNOTICIFATION")
  37. // 加密使用 NSString+MD5
  38. #define DEFAULT_SALT (@"D5sIlPU2")
  39. #define APPSECRET (@"QuMCIKICAgIH0sCiAgICAicGxhdGZvcm0tZGV2IjogW10")
  40. #import "KSSafeObject.h"
  41. #define KSKitDispatchDownloadMediaNotification (@"KSKitDispatchDownloadMediaNotification")
  42. #define KObjNull (id)[NSNull null]
  43. #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
  44. #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
  45. //颜色定义
  46. #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]
  47. #define DEFAULT_HEIGHT (40)
  48. #define KObjNull (id)[NSNull null]
  49. #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
  50. #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
  51. /**宽度比例*/
  52. #define HBJ_ScaleWidth(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
  53. /**高度比例*/
  54. #define HBJ_ScaleHeight(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.height/667)*(__VA_ARGS__)
  55. /**全局字体*/
  56. #define GlobelNormalFont(__VA_ARGS__) ([UIFont systemFontOfSize:HBJ_ScaleFont(__VA_ARGS__)])
  57. /**字体比例*/
  58. #define HBJ_ScaleFont(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
  59. #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]
  60. #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)]
  61. //设备屏幕尺寸
  62. #define kScreen_Height ([UIScreen mainScreen].bounds.size.height)
  63. #define kScreen_Width ([UIScreen mainScreen].bounds.size.width)
  64. #define kScreen_Frame (CGRectMake(0, 0 ,kScreen_Width,kScreen_Height))
  65. #define kScreen_CenterX kScreen_Width/2
  66. #define kScreen_CenterY kScreen_Height/2
  67. //应用尺寸(不包括状态栏,通话时状态栏高度不是20,所以需要知道具体尺寸)
  68. #define kContent_Height ([UIScreen mainScreen].applicationFrame.size.height)
  69. #define kContent_Width ([UIScreen mainScreen].applicationFrame.size.width)
  70. #define kContent_Frame (CGRectMake(0, 0 ,kContent_Width,kContent_Height))
  71. #define kContent_CenterX kContent_Width/2
  72. #define kContent_CenterY kContent_Height/2
  73. #define kWIDTH_RATE (375.0 / kScreen_Width)
  74. #define kHEIGHT_RATE (667.0 / kScreen_Height)
  75. // 防止多次调用
  76. #define kPreventRepeatClickTime(_seconds_) \
  77. static BOOL shouldPrevent; \
  78. if (shouldPrevent) return YES; \
  79. shouldPrevent = YES; \
  80. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((_seconds_) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
  81. shouldPrevent = NO; \
  82. }); \
  83. #define dispatch_main_sync_safe(block)\
  84. if ([NSThread isMainThread]) {\
  85. block();\
  86. } else {\
  87. dispatch_sync(dispatch_get_main_queue(), block);\
  88. }
  89. //1. 测试且 ARC 环境
  90. #ifndef weakObj
  91. #define weakObj(object) autoreleasepool {} __weak __typeof__(object) object##_##weak_ = object;
  92. #endif
  93. #ifndef strongObj
  94. #define strongObj(object) autoreleasepool {} __typeof__(object) object = object##_##weak_;
  95. #endif
  96. //2. 正式且 ARC 环境
  97. #ifndef weakObj
  98. #define weakObj(object) try {} @catch (...){} __weak __typeof__(object) object##_##weak_ = object;
  99. #endif
  100. #ifndef strongObj
  101. #define strongObj(object) try {} @catch (...){} __typeof__(object) object = object##_##weak_;
  102. #endif
  103. // Include any system framework and library headers here that should be included in all compilation units.
  104. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
  105. #import "KSDomain.h"
  106. #endif /* PrefixHeader_pch */