//
//  Constants.h
//  YMD_SDK
//
//  Created by 白红光 on 2018/4/10.
//  Copyright © 2018年 白红光. All rights reserved.
//

#ifndef Constants_h
#define Constants_h

//#ifdef DEBUG
//#define NSLog(FORMAT, ...) fprintf(stderr,"%s\n",[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
//#else
//#define NSLog(...)
//#endif

#define SCREEN_WIDTH                                  ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT                                 ([UIScreen mainScreen].bounds.size.height)
//#define WIDTHRADIUS                                   SCREEN_WIDTH/414.0
//#define HEIGHTRADIUS                                  SCREEN_HEIGHT/736.0
#define WIDTHRADIU                                    SCREEN_WIDTH/375.0
#define HEIGHTRADIU                                   SCREEN_HEIGHT/667.0
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]




//状态栏高度
#define cl_kStatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
//导航栏高度
#define cl_kNavBarHeight (46*WIDTHRADIU)
//tabbar高度
#define cl_kTabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49)
//导航栏/状态栏高度
#define cl_kNavigationBarHeight (cl_kStatusBarHeight + cl_kNavBarHeight)
// UIScreen width.
#define cl_kScreenWidth   [UIScreen mainScreen].bounds.size.width
// UIScreen height.
#define  cl_kScreenHeight  [UIScreen mainScreen].bounds.size.height
// iPhone X
#define  cl_kiPhoneX (cl_kScreenWidth == 375.f && cl_kScreenHeight == 812.f ? YES : NO)
// Tabbar safe bottom margin.
#define  cl_kTabbarSafeBottomMargin    (cl_kiPhoneX ? 34.f : 0.f)
//
#define cl_kSDKVersion [[NSBundle mainBundle]infoDictionary][@"CFBundleShortVersionString"]

// 操作系统版本号
#define cl_IOS_VERSION ([[[UIDevice currentDevice] systemVersion] floatValue])


//判断是否是ipad
#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

//判断iPhone4s系列
#define kiPhone4s ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

//判断iPhone5系列
#define kiPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

//判断iPhone6系列
#define kiPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

//判断iphone6+系列
#define kiPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

//判断iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)

//判断iPHoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)


//判断iPhoneXs Max
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)











#endif /* Constants_h */
