-
-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathKeyboardView.swift
33 lines (30 loc) · 917 Bytes
/
KeyboardView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// KeyboardView.swift
// KeyboardController
//
// Created by Kiryl Ziusko on 19/03/2024.
// Copyright © 2024 Facebook. All rights reserved.
//
import Foundation
import UIKit
enum KeyboardView {
// inspired by https://stackoverflow.com/questions/32598490/show-uiview-with-buttons-over-keyboard-like-in-skype-viber-messengers-swift-i
static func find() -> UIView? {
let windows = UIApplication.shared.windows
for window in windows {
if window.description.hasPrefix("<UITextEffectsWindow") {
for subview in window.subviews {
if subview.description.hasPrefix("<UIInputSetContainerView") {
for hostView in subview.subviews {
if hostView.description.hasPrefix("<UIInputSetHostView"), hostView.frame.height != 0 {
return hostView
}
}
break
}
}
}
}
return nil
}
}