// // CommonMacro.h // FirstLink // // Created by unicode on 14-9-30. // Copyright (c) 2014年 FirstLink. All rights reserved. // #ifndef FirstLink_CommonMacro_h #define FirstLink_CommonMacro_h #define RESPONSE_MSG_NORMAL 1 #define RESPONSE_MSG_BUSINESS_EXCEPTION 42000 #define RESPONSE_MSG_ACCESS_EXCEPTION 46000 //#define ACTION_SHEET_SHARE_TO_WEIXIN_FRIEND 1 //#define ACTION_SHEET_SHARE_TO_WEIXIN_CIRCLE 0 #define SCREEN_WIDTH_SCALE ([UIScreen mainScreen].bounds.size.width/320.0) #define SCREEN_WIDTH_SCALE_6_PLUS (414.0/320.0) #define USER_NOT_EXIST 0 #define REGISTER_USER_NO_PWD 1 #define REGISTER_USER_WITH_PWD 2 #define USER_STATUS_NORMAL 1 #define USER_STATUS_FORBIDDEN 0 #define SHARE_IMAGE_LENGTH 80 #define SHARE_IMAGE_LENGTH_WEIBO 240 #define PAGE_RECORD_COUNT 20 #define MAIN_ITEM_DESC_LEADING 2.0 #define HEAD_PHOTO_LENGTH_25 25 #define HEAD_PHOTO_LENGTH_28 28 #define HEAD_PHOTO_LENGTH_30 30 #define HEAD_PHOTO_LENGTH_32 32 #define HEAD_PHOTO_LENGTH_35 35 #define HEAD_PHOTO_LENGTH_40 40 #define HEAD_PHOTO_LENGTH_45 45 #define HEAD_PHOTO_LENGTH_48 48 #define HEAD_PHOTO_LENGTH_60 60 #define HEAD_PHOTO_LENGTH_64 64 #define HEAD_PHOTO_LENGTH_80 80 #define HEAD_PHOTO_LENGTH_107 107 #define UPLOAD_HEAD_PHOTO_LENGTH 320 #define UIColorFromRGB(rgbValue) \ [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \ blue:((float)((rgbValue & 0x0000FF) >> 0))/255.0 \ alpha:1.0] #define BLUETEXTCOLOR [UIColor colorWithRed:96.0/255.0 green:164.0/255.0 blue:255.0/255.0 alpha:1.0] #define APP_BUTTON_COLOR UIColorFromRGB(0xff624a) #define COMMON_TABLEVIEW_BACKGROUND_COLOR UIColorFromRGB(0xf5f5f5) #define UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) #define _IPHONE80_ 80000 #define HAS_AUTO_SHOWN_ADDRESSBOOK_AUTH_CONTROLLER @"HAS_AUTO_SHOWN_ADDRESSBOOK_AUTH_CONTROLLER" #define LAST_APPLICATION_VERSION @"LAST_APPLICATION_VERSION" //#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) #define IS_IPHONE_4 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )480 ) < DBL_EPSILON ) #define IS_IPHONE_6 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )375 ) < DBL_EPSILON && \ fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )667 ) < DBL_EPSILON) #define IS_IPHONE_6P (fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )414 ) < DBL_EPSILON && \ fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )736 ) < DBL_EPSILON ) #define IS_IPHONE_X ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.width - ( double )375 ) < DBL_EPSILON && \ fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )812 ) < DBL_EPSILON) #define SYSTEM_VERSION ([[UIDevice currentDevice] systemVersion]) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([SYSTEM_VERSION compare:v options:NSNumericSearch] != NSOrderedAscending) #define IS_OS_7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0 && [[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) #define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) #define IS_OS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) #define WeakSelf(weakSelf) __weak __typeof(&*self)weakSelf = self; #define UISCREENWIDTH [UIScreen mainScreen].bounds.size.width #define UISCREENHEIGH [UIScreen mainScreen].bounds.size.height #define EXT_MSG_MESSAGE_TYPE @"message_type" #define EXT_MSG_ORDER_PIC @"order_pic" #define EXT_MSG_ORDER_TITLE @"order_title" #define EXT_MSG_ORDER_PRICE @"order_price" #define EXT_MSG_ORDER_UID @"order_uid" #define EXT_MSG_ORDER_ID @"order_id" #define EXT_MSG_TYPE_V2 @"msgtype" #define EXT_QUEUE_NAME @"queueName" #define EXT_MSG_TYPE_TRACK_V2 @"track" #define EXT_MSG_TYPE_ORDER_V2 @"order" #define EXT_MSG_TITLE_V2 @"title" #define EXT_MSG_ORDER_TITLE_V2 @"order_title" #define EXT_MSG_DESC_V2 @"desc" #define EXT_MSG_PRICE_V2 @"price" #define EXT_MSG_PIC_URL_V2 @"img_url" #define EXT_MSG_ITEM_URL_V2 @"item_url" #define EXT_MSG_USER_ID_V2 @"user_id" #define EXT_MSG_POST_ID_V2 @"post_id" #define EXT_MSG_GOODS_ID_V2 @"goods_id" #endif