mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various Fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user