/**
设备名称 屏幕尺寸 像素 点
Phone 2G \ iPhone 3G \ iPhone 3GS 3.5″ 320*480 320*480 @1x
iPhone 4 \ iPhone 4S 3.5″ 640*960 320*480 @2x
iPhone 5 \ iPhone 5C \ iPhone 5S \ iPhone SE(一代) 4″ 640*1136 320*568 @2x
iPhone 6 \ iPhone 6S \ iPhone 7 \ iPhone 8 \ iPhone SE(二代) 4.7″ 750*1334 375*667 @2x
iPhone 6+ \ iPhone 6S+ \ iPhone 7+ \ iPhone 8+ 5.5″ 1242*2208 414*736 @3x
iPhone X \ iPhone XS \ iPhone 11 Pro 5.8″ 1125*2436 375*812 @3x
iPhone XR \ iPhone 11 6.1″ 828*1792 414*896 @2x
iPhone XS Max \ iPhone 11 Pro Max 6.5″ 1242*2688 414*896 @3x
状态栏高度
非全面屏:20pt
全面屏:44pt
安全区域高度:34pt
*/
/**
判断是否是ipad
*/
let isPad = UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad
/**
机型的屏幕大小
*/
let Device_iPhoneX = __CGSizeEqualToSize(CGSize.init(width: 1125/3, height: 2436/3), UIScreen.main.bounds.size)
let Device_iPhoneXr = __CGSizeEqualToSize(CGSize.init(width: 828/2, height: 1792/2), UIScreen.main.bounds.size)
let Device_iPhoneXs = __CGSizeEqualToSize(CGSize.init(width: 1125/3, height: 2436/3), UIScreen.main.bounds.size)
let Device_iPhoneXs_Max = __CGSizeEqualToSize(CGSize.init(width: 1242/3, height: 2688/3), UIScreen.main.bounds.size)
let isIphoneX_Type = (Device_iPhoneX || Device_iPhoneXr || Device_iPhoneXs||Device_iPhoneXs_Max)
/**
状态栏高度
*/
let kDevice_StateBarHight: CGFloat = (isIphoneX_Type ? 44:20)
/**
顶部状态栏+导航高度
*/
let kDevice_TopSpaceHight: CGFloat = (isIphoneX_Type ? 88:64)
/**
底部安全区域的高度
*/
let kDevice_BottomSafeHeight: CGFloat = (isIphoneX_Type ? 34:0)
/**
手机屏幕宽度
*/
let kDevice_Width = UIScreen.main.bounds.size.width
/**
手机屏幕高度
*/
let kDevice_Hight = UIScreen.main.bounds.size.height
网友评论