mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Code style change
This commit is contained in:
@@ -3,13 +3,15 @@ import UIKit
|
||||
|
||||
struct SafeArea {
|
||||
static var insets: UIEdgeInsets {
|
||||
let keyWindow = UIApplication.shared.connectedScenes
|
||||
.filter { $0.activationState == .foregroundActive }
|
||||
.compactMap { $0 as? UIWindowScene }
|
||||
.first?
|
||||
.windows
|
||||
.first { $0.isKeyWindow }
|
||||
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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user