mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
18 lines
436 B
Swift
18 lines
436 B
Swift
import Foundation
|
|
import UIKit
|
|
|
|
struct SafeArea {
|
|
static var insets: UIEdgeInsets {
|
|
let keyWindow = scene?.windows.first { $0.isKeyWindow }
|
|
|
|
return keyWindow?.safeAreaInsets ?? .init()
|
|
}
|
|
|
|
static var scene: UIWindowScene? {
|
|
UIApplication.shared.connectedScenes
|
|
.filter { $0.activationState == .foregroundActive }
|
|
.compactMap { $0 as? UIWindowScene }
|
|
.first
|
|
}
|
|
}
|