Files
yingmeng-ios-switf/yinmeng-ios/Base/Utils/Utils.swift
2024-02-26 23:04:17 +08:00

37 lines
900 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)
let DesKey = "1ea53d260ecf11e7b56e00163e046a26"
let API_URL = "http://beta.api.ymlive.fun"
let H5_URL = "http://beta.h5.ymlive.fun"