//
//  UIDevice+Add.swift
//  FuWan
//
//  Created by soldoros on 2021/8/2.
//

import UIKit

extension UIDevice{
    
    
    
    //获取状态栏高度
    class func getStatuBarHeight()->CGFloat{
        return UIApplication.shared.statusBarFrame.height
    }
    
    //获取导航栏高度
    class func getNavGationBarHeight()->CGFloat{
        return 44.0
    }
    
    //获取标签栏高度
    class func getTabBarHeight()->CGFloat{
        return 49.0
    }
    
    //获取顶部安全区域
    class func getSafeAreaTopHeight()->CGFloat{
        return self.getStatuBarHeight() + 44
    }
    
    //获取底部安全区域(iPhone X有）
    class func getSafeAreaBottomHeight()->CGFloat{
        return self.getStatuBarHeight() == 20 ? 0 : 34
    }
    
    //获取屏幕高度
    class func getSCREEN_Height()->CGFloat{
        return UIScreen.main.bounds.size.height
    }
    
    //获取屏幕宽度
    class func getSCREEN_Width()->CGFloat{
        return UIScreen.main.bounds.size.width
    }
    
    
    //获取根页面主视图区域的高度
    class func getMainViewSub_Height()->CGFloat{
        return self.getSCREEN_Height() - self.getSafeAreaTopHeight() - self.getSafeAreaBottomHeight()
    }
    
    //获取子页面主视图区域的高度
    class func getMainViewRoot_Height()->CGFloat{
        return self.getMainViewSub_Height() - self.getTabBarHeight()
    }
}
