| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- //
- // AppDef.h
- // Zhuawawa
- //
- // Created by 曹福涛 on 2017/11/29.
- // Copyright © 2017年 kennethmiao. All rights reserved.
- //
- #ifndef AppDef_h
- #define AppDef_h
- #import <UIKit/UIKit.h>
- #import <AdSupport/AdSupport.h>
- #define PageSize 20 //接口分页pagesize
- #define REQUEST_FAIL @"请求失败"
- #define BASE_API @"http://test.ttdj.ttdianjing.com"
- #define VIP_API_WITH(var) [BASE_API stringByAppendingString:var]
- #define QUERY_USER_VIP VIP_API_WITH(@"/user/queryUserVip")
- #define VIP_GRADE_LIST VIP_API_WITH(@"/user/vipList")
- #pragma mark - 尺寸
- #define kScreen_width [UIScreen mainScreen].bounds.size.width
- #define kScreen_height [UIScreen mainScreen].bounds.size.height
- #define NAVBAR_HEIGHT 44
- #define CELL_HEIGHT 49
- #define TABBAR_HEIGHT (IS_IPHONEX ? 83:49)
- #define STATUSBAR_HEIGHT [[UIApplication sharedApplication] statusBarFrame].size.height
- #define NAV_HEIGHT (NAVBAR_HEIGHT+STATUSBAR_HEIGHT)
- #define H_10 10.f
- #define H_15 15.f
- #define H_20 20.f
- #define H_25 25.f
- #define H_30 30.f
- #define H_40 40.f
- #pragma mark - 设备
- #define IS_IPHONE4 (([[UIScreen mainScreen] bounds].size.height-480)?NO:YES)
- #define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)
- #define IS_IPHONE6 (([[UIScreen mainScreen] bounds].size.height-667)?NO:YES)
- #define IS_IPHONE6P (([[UIScreen mainScreen] bounds].size.height-736)?NO:YES)
- #define IS_IPHONEX ([UIScreen mainScreen].bounds.size.height == 812 || [UIScreen mainScreen].bounds.size.height == 896)
- //#define IS_IPHONEX \
- //({BOOL isPhoneX = NO;\
- //if (@available(iOS 11.0, *)) {\
- //isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
- //}\
- //(isPhoneX);})
- #define SAFEAREA_BOTTOMHEIGHT (IS_IPHONEX?34.f:0.f)
- #pragma mark - 字体
- #define FONT_10 [UIFont systemFontOfSize:10]
- #define FONT_11 [UIFont systemFontOfSize:11]
- #define FONT_12 [UIFont systemFontOfSize:12]
- #define FONT_13 [UIFont systemFontOfSize:13]
- #define FONT_14 [UIFont systemFontOfSize:14]
- #define FONT_15 [UIFont systemFontOfSize:15]
- #define FONT_16 [UIFont systemFontOfSize:16]
- #define FONT_17 [UIFont systemFontOfSize:17]
- #define FONT_18 [UIFont systemFontOfSize:18]
- #define FONT_20 [UIFont systemFontOfSize:20]
- #define FONT_21 [UIFont systemFontOfSize:21]
- #define FONT_22 [UIFont systemFontOfSize:22]
- #define FONT_24 [UIFont systemFontOfSize:24]
- #define FONT_40 [UIFont systemFontOfSize:40]
- #pragma mark - 颜色
- #define RGBACOLOR(r, g, b, a) [UIColor colorWithRed : (r) / 255.0f green : (g) / 255.0f blue : (b) / 255.0f alpha : (a)]
- #define COLOR_D1A956 HexColor(@"D1A956")
- #define COLOR_8F8F8F HexColor(@"8F8F8F")
- #define COLOR_FEE1B3 HexColor(@"FEE1B3")
- #define COLOR_1A1A1A HexColor(@"1A1A1A")
- #define COLOR_E6 HexColor(@"E6E6E6")
- #define COLOR_3EC6FF HexColor(@"3EC6FF")
- #define COLOR_167DE7 HexColor(@"167DE7")
- #define COLOR_DEDEDE HexColor(@"DEDEDE")
- #define COLOR_F5F5F5 HexColor(@"F5F5F5")
- #define COLOR_212121 HexColor(@"212121")
- NS_INLINE UIColor* HexColor(NSString *inColorString) {
- UIColor *result = nil;
- unsigned int colorCode = 0;
- unsigned char redByte, greenByte, blueByte;
-
- if (nil != inColorString) {
- NSScanner *scanner = [NSScanner scannerWithString:inColorString];
- (void)[scanner scanHexInt:&colorCode]; // ignore error
- }
- redByte = (unsigned char)(colorCode >> 16);
- greenByte = (unsigned char)(colorCode >> 8);
- blueByte = (unsigned char)(colorCode); // masks off high bits
- result = [UIColor
- colorWithRed:(float)redByte / 0xff
- green:(float)greenByte / 0xff
- blue:(float)blueByte / 0xff
- alpha:1.0];
- return result;
- }
- #endif /* AppDef_h */
|