let keywindow = UIApplication.shared.windows.filter { $0.isKeyWindow }.first!
var isPhoneX: Bool {
if #available(iOS 11.0, *) {
return keywindow.safeAreaInsets.bottom > 0
}
return false
}
let isPad = UIDevice.current.userInterfaceIdiom == .pad
enum UtilMetric {
static let screenWidth = UIScreen.main.bounds.size.width
static let screenHeight = UIScreen.main.bounds.size.height
static let margin : CGFloat = 14
}
enum UtilConstant {
static let navBarHeight: CGFloat = isPhoneX ? 88 : 64
static let statusBarHeigth: CGFloat = isPhoneX ? 44 : 20
static let tabbarHeight: CGFloat = isPhoneX ? 83 : 49
static let bottomMargin: CGFloat = isPhoneX ? 34 : 0
}