//
//  PrefixHeader.pch
//  Dolphins
//
//  Created by Company on 2020/6/3.
//  Copyright © 2020 Company. All rights reserved.
//

#ifndef __OPTIMIZE__
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define NSLog(...) {}
#endif

// WeakSelf
#define WeakSelf(weakSelf) __weak typeof(self) weakSelf = self;
// StrongSelf
#define StrongSelf(strongSelf) __strong typeof(weakSelf) strongSelf = weakSelf;

// 状态栏的高度
#define StatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
// 状态栏高度差值
#define StatusBarDif StatusBarHeight - 20
// x系列底部横条高度
#define Bottom_Space \
({double isPhoneX = 0;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom;\
}\
(isPhoneX);})

//定义物理屏幕的尺寸
#define KScreenHeight   [UIScreen mainScreen].bounds.size.height
#define KScreenWidth    [UIScreen mainScreen].bounds.size.width

// 以4.7寸屏幕为基准的缩放
#define WIDTHSCALE(awidth) [UIScreen mainScreen].bounds.size.width / 375.0 * awidth
#define HEIGHTSCALE(aheight) [UIScreen mainScreen].bounds.size.width / 375.0 * aheight

//相对iphone6布局
#define scale_w KScreenWidth / 375.0
#define scale_h KScreenHeight / 667.0

#define ConvertHeightByImageWidth(widht, height) (KScreenWidth * (height / (widht * 1.0)))

#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)568) < DBL_EPSILON)
#define IS_IPHONE_6 ([[UIScreen mainScreen] bounds].size.height == 667.0f)
#define IS_IPHONE_6_PLUS ([[UIScreen mainScreen] bounds].size.height == 736.0f)

//判断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)
//判断iPHoneXr放大模式
#define IS_IPHONE_Xr_M ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1624), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
//判断iPhoneXs
#define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[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)

#define IOS10_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define XTopMargin ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xr_M==YES ||IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 24.0 : 0.0)
#define XBottomMargin ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xr_M==YES ||IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 34.0 : 0)

#define kTabBarHeight (49.0 + XBottomMargin)
#define kNavigationBarHeight (64 + XTopMargin)
#define kStatusBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height)
#define KScaleWidth(width) ((width)*(KScreenWidth/375.f))

#define KScreenBounds ([UIScreen mainScreen].bounds)
//#define KScreenWidth ([UIScreen mainScreen].bounds.size.width)
//#define KScreenHeight ([UIScreen mainScreen].bounds.size.height)
#define KScaleWidth(width) ((width)*(KScreenWidth/375.f))

#define KFont(font) (font * (KScreenWidth < 375 ? 0.8 : 1.0))
//色值
#define kColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define kColorWithRGB(r, g, b) [UIColor colorWithRed:(r) / 255.f green:(g) / 255.f blue:(b) / 255.f alpha:1.f]
#define rgba(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]

#import "ShorthandMaster-Swift.h"
// 第三方头文件
#import <Masonry.h>

#ifndef PrefixHeader_pch
#define PrefixHeader_pch



#endif /* PrefixHeader_pch */
