Geen omschrijving

CommonMacro.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // CommonMacro.h
  3. // FirstLink
  4. //
  5. // Created by unicode on 14-9-30.
  6. // Copyright (c) 2014年 FirstLink. All rights reserved.
  7. //
  8. #ifndef FirstLink_CommonMacro_h
  9. #define FirstLink_CommonMacro_h
  10. #define RESPONSE_MSG_NORMAL 1
  11. #define RESPONSE_MSG_BUSINESS_EXCEPTION 42000
  12. #define RESPONSE_MSG_ACCESS_EXCEPTION 46000
  13. //#define ACTION_SHEET_SHARE_TO_WEIXIN_FRIEND 1
  14. //#define ACTION_SHEET_SHARE_TO_WEIXIN_CIRCLE 0
  15. #define SCREEN_WIDTH_SCALE ([UIScreen mainScreen].bounds.size.width/320.0)
  16. #define SCREEN_WIDTH_SCALE_6_PLUS (414.0/320.0)
  17. #define USER_NOT_EXIST 0
  18. #define REGISTER_USER_NO_PWD 1
  19. #define REGISTER_USER_WITH_PWD 2
  20. #define USER_STATUS_NORMAL 1
  21. #define USER_STATUS_FORBIDDEN 0
  22. #define SHARE_IMAGE_LENGTH 80
  23. #define SHARE_IMAGE_LENGTH_WEIBO 240
  24. #define PAGE_RECORD_COUNT 20
  25. #define MAIN_ITEM_DESC_LEADING 2.0
  26. #define HEAD_PHOTO_LENGTH_25 25
  27. #define HEAD_PHOTO_LENGTH_28 28
  28. #define HEAD_PHOTO_LENGTH_30 30
  29. #define HEAD_PHOTO_LENGTH_32 32
  30. #define HEAD_PHOTO_LENGTH_35 35
  31. #define HEAD_PHOTO_LENGTH_40 40
  32. #define HEAD_PHOTO_LENGTH_45 45
  33. #define HEAD_PHOTO_LENGTH_48 48
  34. #define HEAD_PHOTO_LENGTH_60 60
  35. #define HEAD_PHOTO_LENGTH_64 64
  36. #define HEAD_PHOTO_LENGTH_80 80
  37. #define HEAD_PHOTO_LENGTH_107 107
  38. #define UPLOAD_HEAD_PHOTO_LENGTH 320
  39. #define UIColorFromRGB(rgbValue) \
  40. [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
  41. green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \
  42. blue:((float)((rgbValue & 0x0000FF) >> 0))/255.0 \
  43. alpha:1.0]
  44. #define BLUETEXTCOLOR [UIColor colorWithRed:96.0/255.0 green:164.0/255.0 blue:255.0/255.0 alpha:1.0]
  45. #define APP_BUTTON_COLOR UIColorFromRGB(0xff624a)
  46. #define COMMON_TABLEVIEW_BACKGROUND_COLOR UIColorFromRGB(0xf5f5f5)
  47. #define UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
  48. #define _IPHONE80_ 80000
  49. #define HAS_AUTO_SHOWN_ADDRESSBOOK_AUTH_CONTROLLER @"HAS_AUTO_SHOWN_ADDRESSBOOK_AUTH_CONTROLLER"
  50. #define LAST_APPLICATION_VERSION @"LAST_APPLICATION_VERSION"
  51. //#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
  52. #define IS_IPHONE_4 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )480 ) < DBL_EPSILON )
  53. #define IS_IPHONE_6 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )375 ) < DBL_EPSILON && \
  54. fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )667 ) < DBL_EPSILON)
  55. #define IS_IPHONE_6P (fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )414 ) < DBL_EPSILON && \
  56. fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )736 ) < DBL_EPSILON )
  57. #define IS_IPHONE_X ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )375 ) < DBL_EPSILON && \
  58. fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )812 ) < DBL_EPSILON)
  59. #define SYSTEM_VERSION ([[UIDevice currentDevice] systemVersion])
  60. #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([SYSTEM_VERSION compare:v options:NSNumericSearch] != NSOrderedAscending)
  61. #define IS_OS_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 8.0)
  62. #define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
  63. #define IS_OS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
  64. #define WeakSelf(weakSelf) __weak __typeof(&*self)weakSelf = self;
  65. #define UISCREENWIDTH [UIScreen mainScreen].bounds.size.width
  66. #define UISCREENHEIGH [UIScreen mainScreen].bounds.size.height
  67. #define EXT_MSG_MESSAGE_TYPE @"message_type"
  68. #define EXT_MSG_ORDER_PIC @"order_pic"
  69. #define EXT_MSG_ORDER_TITLE @"order_title"
  70. #define EXT_MSG_ORDER_PRICE @"order_price"
  71. #define EXT_MSG_ORDER_UID @"order_uid"
  72. #define EXT_MSG_ORDER_ID @"order_id"
  73. #define EXT_MSG_TYPE_V2 @"msgtype"
  74. #define EXT_QUEUE_NAME @"queueName"
  75. #define EXT_MSG_TYPE_TRACK_V2 @"track"
  76. #define EXT_MSG_TYPE_ORDER_V2 @"order"
  77. #define EXT_MSG_TITLE_V2 @"title"
  78. #define EXT_MSG_ORDER_TITLE_V2 @"order_title"
  79. #define EXT_MSG_DESC_V2 @"desc"
  80. #define EXT_MSG_PRICE_V2 @"price"
  81. #define EXT_MSG_PIC_URL_V2 @"img_url"
  82. #define EXT_MSG_ITEM_URL_V2 @"item_url"
  83. #define EXT_MSG_USER_ID_V2 @"user_id"
  84. #define EXT_MSG_POST_ID_V2 @"post_id"
  85. #define EXT_MSG_GOODS_ID_V2 @"goods_id"
  86. #endif