iPhone刘海屏系列适配判断
///MARK: iPhone X 刘海屏系列宏定义判断(适用目前所有的iPhone刘海屏)
#define IPHONE_X \
({BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})
安全距离
/// iPhone X 系列 顶部适配
//statusBar Height
#define kStatusBarHeight (IPHONE_X ? 44.f : 20.f)
//nav Height
#define kTopNavHeight (kStatusBarHeight + 44.f)
/// iPhone X 系列底部适配
//底部安全距离
#define kSafeAreaBottomHeight (IPHONE_X ? 34.f : 0.f)
//TabBar Height
#define kBottomTabBarHeight (kSafeAreaBottomHeight + 49.f)