// // KDPHeightTool.m // KuDianProject // // Created by admin on 2019/7/4. // Copyright © 2019 KDP. All rights reserved. // #import "KDPHeightTool.h" @implementation KDPHeightTool /** * 键盘安全区域 * * @return 34 */ + (CGFloat)getSafeBottom{ if (@available(iOS 11.0, *)) { return [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom; } else { return 0; } } /** * tabbar 高度 * * @return 49 + 安全区域 */ + (CGFloat)gettabbarHeight{ return 49 + [self getSafeBottom]; } /** * statusBar 高度 * * @return 20 或 44(iPhone X) */ + (CGFloat)getStatusBarHeight{ return [[UIApplication sharedApplication] statusBarFrame].size.height; } /** * navigationBar 高度 * * @return 64 或 88(iPhone X) */ + (CGFloat)getNavigationBarHeight{ return 44 + [self getStatusBarHeight]; } @end