PrefixHeader.pch 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // PrefixHeader.pch
  3. // 唔即云相册
  4. //
  5. // Created by 余衡武 on 2021/12/8.
  6. //
  7. #ifndef PrefixHeader_pch
  8. #define PrefixHeader_pch
  9. #ifdef DEBUG // 调试状态, 打开LOG功能
  10. #define KyoLog(fmt, ...) NSLog((@"%s [LinE %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
  11. #define KyoAlert(fmt, ...) { [[[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [LinE %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__] delegate:nil cancelButtonTitle:@"OK(debug mode)" otherButtonTitles:nil] show]; }
  12. #define XYLog(fmt, ...) NSLog((@"%s [LinE %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
  13. #else // 发布状态, 关闭LOG功能
  14. #define KyoLog(...) (void)0;
  15. #define KyoAlert(...) (void)0;
  16. #define XYLog(...) (void)0;
  17. #endif
  18. #define ksharedAppDelegate [AppDelegate sharedAppDelegate] // AppDelegate 单例
  19. /**第三方库*/
  20. #import "Masonry.h"
  21. #import "UIView+HWCategory.h"
  22. #import "UIScrollView+EmptyDataSet.h"
  23. /**工具类*/
  24. #import "iToast.h"
  25. #import "iTools.h"
  26. #import "HWDataManager.h"
  27. /**配置文件*/
  28. #import "Const.h"
  29. #import "Enum.h"
  30. #import "Notification.h"
  31. #import "ColorDefine.h"
  32. #import "BaseModel.h"
  33. #define globalBlock(block) dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), block)
  34. /**宏定义*/
  35. #define mainBlock(block) dispatch_async(dispatch_get_main_queue(), block)
  36. #define KWeakSelf __weak typeof(*&self) weakSelf = self; //block 快速宏定义
  37. #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
  38. #define HLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
  39. #define SCREEN_W [[UIScreen mainScreen] bounds].size.width
  40. #define SCREEN_H [[UIScreen mainScreen] bounds].size.height
  41. #define H_NAV_BAR self.navigationController.navigationBar.frame.size.height
  42. #define H_STATE_BAR [[UIApplication sharedApplication] statusBarFrame].size.height
  43. #define WAUTOSCALE ([[UIScreen mainScreen] bounds].size.width / 375) // 缩放比例
  44. #define HAUTOSCALE ([[UIScreen mainScreen] bounds].size.height / 667)
  45. //泛指刘海屏
  46. #define IPHONE_X ({\
  47. BOOL isBangsScreen = NO; \
  48. if (@available(iOS 11.0, *)) { \
  49. UIWindow *window = [[UIApplication sharedApplication].windows firstObject]; \
  50. isBangsScreen = window.safeAreaInsets.bottom > 0; \
  51. } \
  52. isBangsScreen; \
  53. })
  54. #define safeArea (IPHONE_X ? 44.f : 0.f) //安全区域
  55. #define NAVIHEIGHT (IPHONE_X ? 88 : 64) //导航
  56. #define TABBARHEIGHT (IPHONE_X ? 83 : 49) // 分栏
  57. #define AdaptTabHeight (IPHONE_X ? 34 : 0) //Tabbar 圆角部分高度
  58. #define AdaptNaviHeight (IPHONE_X ? 24 : 0) //状态栏高度
  59. #define AUTOSCALE ([[UIScreen mainScreen] bounds].size.width / 375)
  60. #define WAUTOSCALE ([[UIScreen mainScreen] bounds].size.width / 375)
  61. #define HAUTOSCALE ([[UIScreen mainScreen] bounds].size.height / 667)
  62. #define CloudService @"http://14.18.190.141:11180"
  63. //#define CloudService @"http://14.18.190.141:1280"
  64. #define FileService @"http://file.phone.androidscloud.com:8210"
  65. #define Const_File_Access_Key @"13d0arghebcc4cm49cf04"
  66. #define CloudGameService @"http://14.18.190.140:9090"
  67. #define FileAPPManifestKey Const_File_APP_Manifest_Key_test
  68. #pragma mark 音频相关宏定义
  69. #define USEAAC NO
  70. #define AACTOPCM YES
  71. #define USEAQAAC NO
  72. #define USEOPENGL YES
  73. #define P2PModelList_bg_tableName(userName) [[NSString alloc] initWithFormat:@"P2PModelList_bg_tableName_%@",userName];
  74. #define DB_HWBuryPointModelList_TableName @"DB_HWBuryPointModelList_New"
  75. #endif /* PrefixHeader_pch */