Skip to content
Snippets Groups Projects
Commit 91ff9a24 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Fixes retrieving key window crash

parent 6f876864
No related branches found
No related tags found
2 merge requests!77Releasing 1.1.6 (219),!76Fixes retrieving key window crash
...@@ -530,12 +530,10 @@ extension SingleChatController: KeyboardListenerDelegate { ...@@ -530,12 +530,10 @@ extension SingleChatController: KeyboardListenerDelegate {
} }
func keyboardWillChangeFrame(info: KeyboardInfo) { func keyboardWillChangeFrame(info: KeyboardInfo) {
let keyWindow: UIWindow? = UIApplication.shared.connectedScenes let keyWindow = UIApplication.shared
.filter { $0.activationState == .foregroundActive } .connectedScenes
.compactMap { $0 as? UIWindowScene } .flatMap { ($0 as? UIWindowScene)?.windows ?? [] }
.first? .first { $0.isKeyWindow }
.windows
.first(where: \.isKeyWindow)
guard let keyWindow = keyWindow else { guard let keyWindow = keyWindow else {
fatalError("[keyboardWillChangeFrame]: Couldn't get key window") fatalError("[keyboardWillChangeFrame]: Couldn't get key window")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment