Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-01-29 17:36:07 +03:00
parent 92c06c45b2
commit e67b193c73
10 changed files with 4066 additions and 4007 deletions

View File

@@ -7,6 +7,22 @@ struct KeyboardSurface {
let host: UIView
}
public extension UIResponder {
private struct Static {
static weak var responder: UIResponder?
}
static func currentFirst() -> UIResponder? {
Static.responder = nil
UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil)
return Static.responder
}
@objc private func _trap() {
Static.responder = self
}
}
private func getFirstResponder(_ view: UIView) -> UIView? {
if view.isFirstResponder {
return view