PrefixHeader.pch 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 "MBProgressHUD+KSShow.h"
  26. #import "UIControl+ButtonAction.h"
  27. #import "UIView+KSExtension.h"
  28. #import "Macro.h"
  29. #import "KSGifRefreshHeader.h"
  30. #import "KSGifRefreshFooter.h"
  31. #import "KSUploadManager.h"
  32. #import "UIView+SubViewExtension.h"
  33. #import "NSObject+KSDateFormatter.h"
  34. #define FIRST_LOGIN_KEY (@"FirstLoginKey")
  35. #define DEALCALLBACKNOTICIFATION (@"DEALCALLBACKNOTICIFATION")
  36. // 加密使用 NSString+MD5
  37. #define DEFAULT_SALT (@"D5sIlPU2")
  38. #define APPSECRET (@"QuMCIKICAgIH0sCiAgICAicGxhdGZvcm0tZGV2IjogW10")
  39. #import "KSSafeObject.h"
  40. #define KSKitDispatchDownloadMediaNotification (@"KSKitDispatchDownloadMediaNotification")
  41. #define KObjNull (id)[NSNull null]
  42. #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
  43. #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
  44. //颜色定义
  45. #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]
  46. #define DEFAULT_HEIGHT (40)
  47. #define KObjNull (id)[NSNull null]
  48. #define UserDefault(_key_) [[NSUserDefaults standardUserDefaults] objectForKey:_key_]
  49. #define UserDefaultSet(_value_,_key_) ([[NSUserDefaults standardUserDefaults] setValue:_value_ forKey:_key_])
  50. /**宽度比例*/
  51. #define HBJ_ScaleWidth(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
  52. /**高度比例*/
  53. #define HBJ_ScaleHeight(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.height/667)*(__VA_ARGS__)
  54. /**全局字体*/
  55. #define GlobelNormalFont(__VA_ARGS__) ([UIFont systemFontOfSize:HBJ_ScaleFont(__VA_ARGS__)])
  56. /**字体比例*/
  57. #define HBJ_ScaleFont(__VA_ARGS__) ([UIScreen mainScreen].bounds.size.width/375)*(__VA_ARGS__)
  58. #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]
  59. #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)]
  60. //设备屏幕尺寸
  61. #define kScreen_Height ([UIScreen mainScreen].bounds.size.height)
  62. #define kScreen_Width ([UIScreen mainScreen].bounds.size.width)
  63. #define kScreen_Frame (CGRectMake(0, 0 ,kScreen_Width,kScreen_Height))
  64. #define kScreen_CenterX kScreen_Width/2
  65. #define kScreen_CenterY kScreen_Height/2
  66. //应用尺寸(不包括状态栏,通话时状态栏高度不是20,所以需要知道具体尺寸)
  67. #define kContent_Height ([UIScreen mainScreen].applicationFrame.size.height)
  68. #define kContent_Width ([UIScreen mainScreen].applicationFrame.size.width)
  69. #define kContent_Frame (CGRectMake(0, 0 ,kContent_Width,kContent_Height))
  70. #define kContent_CenterX kContent_Width/2
  71. #define kContent_CenterY kContent_Height/2
  72. #define kWIDTH_RATE (375.0 / kScreen_Width)
  73. #define kHEIGHT_RATE (667.0 / kScreen_Height)
  74. // 防止多次调用
  75. #define kPreventRepeatClickTime(_seconds_) \
  76. static BOOL shouldPrevent; \
  77. if (shouldPrevent) return YES; \
  78. shouldPrevent = YES; \
  79. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((_seconds_) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ \
  80. shouldPrevent = NO; \
  81. }); \
  82. #define dispatch_main_sync_safe(block)\
  83. if ([NSThread isMainThread]) {\
  84. block();\
  85. } else {\
  86. dispatch_sync(dispatch_get_main_queue(), block);\
  87. }
  88. //1. 测试且 ARC 环境
  89. #ifndef weakObj
  90. #define weakObj(object) autoreleasepool {} __weak __typeof__(object) object##_##weak_ = object;
  91. #endif
  92. #ifndef strongObj
  93. #define strongObj(object) autoreleasepool {} __typeof__(object) object = object##_##weak_;
  94. #endif
  95. //2. 正式且 ARC 环境
  96. #ifndef weakObj
  97. #define weakObj(object) try {} @catch (...){} __weak __typeof__(object) object##_##weak_ = object;
  98. #endif
  99. #ifndef strongObj
  100. #define strongObj(object) try {} @catch (...){} __typeof__(object) object = object##_##weak_;
  101. #endif
  102. // Include any system framework and library headers here that should be included in all compilation units.
  103. // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
  104. //#ifdef DEBUG
  105. //#define hostURL (@"https://dev.colexiu.com")
  106. //#define SEALCLASSHOST (@"https://dev.colexiu.com/api-classroom")
  107. //#define WEBHOST (@"https://dev.colexiu.com/student")
  108. //#define SOCKET_URL (@"wss://dev.colexiu.com/audioAnalysis")
  109. //#define JSPUSH_ENVIRONMENT (NO)
  110. //#define RCIM_KEY (@"0vnjpoad0jbdz")
  111. //#define SUBMIT_UUID (YES)
  112. // 预生产环境
  113. //#define hostURL (@"https://ponline.colexiu.com")
  114. //#define SEALCLASSHOST (@"https://ponline.colexiu.com/api-classroom")
  115. //#define WEBHOST (@"https://ponline.colexiu.com/student")
  116. //#define SOCKET_URL (@"wss://ponline.colexiu.com/audioAnalysis")
  117. //#define JSPUSH_ENVIRONMENT (NO)
  118. //#define RCIM_KEY (@"0vnjpoad0jbdz")
  119. //#define SUBMIT_UUID (NO)
  120. //#else
  121. #define hostURL (@"https://online.colexiu.com")
  122. #define SEALCLASSHOST (@"https://online.colexiu.com/api-classroom")
  123. #define WEBHOST (@"https://online.colexiu.com/student")
  124. #define SOCKET_URL (@"wss://online.colexiu.com/audioAnalysis")
  125. #define JSPUSH_ENVIRONMENT (YES)
  126. #define RCIM_KEY (@"e5t4ouvpe42pa")
  127. #define SUBMIT_UUID (YES)
  128. //#endif
  129. #endif /* PrefixHeader_pch */