30 lines
764 B
Swift
30 lines
764 B
Swift
//
|
|
// Utils.swift
|
|
// yinmeng-ios
|
|
//
|
|
// Created by MaiMang on 2024/2/21.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
private var isSafeScreen: Bool {
|
|
if #available(iOS 11, *) {
|
|
guard let w = UIApplication.shared.delegate?.window, let unwrapedWindow = w else {
|
|
return false
|
|
}
|
|
if unwrapedWindow.safeAreaInsets.left > 0 || unwrapedWindow.safeAreaInsets.bottom > 0 {
|
|
print(unwrapedWindow.safeAreaInsets)
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
let ScreenWidth = UIScreen.main.bounds.size.width
|
|
let ScreenHeight = UIScreen.main.bounds.size.height
|
|
let StatusBarHeight = UIApplication.shared.statusBarFrame.height
|
|
let SafeAraeBottomHeight = isSafeScreen ? 34.0 : 0.0
|
|
let SafeAraeTopmHeight = isSafeScreen ? 24.0 : 0.0
|
|
let NavHeight = (StatusBarHeight + 44)
|
|
let TabHeight = (49)
|