// // KXGetHeightTool.m // CAISHEN // // Created by admin on 2018/10/11. // Copyright © 2018 kuxuan. All rights reserved. // #import "KXGetHeightTool.h" @implementation KXGetHeightTool /** * 键盘安全区域 * * @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