Move safeAreaInset ref to Theme

This commit is contained in:
OlegAba
2023-02-09 18:22:48 -05:00
parent 9ab03034a2
commit d43a2ff92d
2 changed files with 11 additions and 11 deletions

View File

@@ -25,4 +25,12 @@ class Theme {
UINavigationBar.appearance().tintColor = tintColor ?? titleColor ?? .black
}
static var safeAreaInsets: UIEdgeInsets? {
return UIApplication
.shared
.connectedScenes
.flatMap { ($0 as? UIWindowScene)?.windows ?? [] }
.first { $0.isKeyWindow }?.safeAreaInsets
}
}