Code style change

This commit is contained in:
Arkadiusz Fal
2022-08-13 16:12:45 +02:00
parent e609e90165
commit f828943982
4 changed files with 64 additions and 48 deletions

View File

@@ -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
}
}