mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 02:49:57 +00:00
29 lines
733 B
Swift
29 lines
733 B
Swift
import Foundation
|
|
import UIKit
|
|
|
|
public class KeyboardHostWindow: UIWindow {
|
|
public let textField: UITextField
|
|
|
|
convenience public init() {
|
|
self.init(frame: CGRect())
|
|
}
|
|
|
|
override init(frame: CGRect) {
|
|
self.textField = UITextField(frame: CGRect(x: -110.0, y: 0.0, width: 100.0, height: 50.0))
|
|
|
|
super.init(frame: frame)
|
|
|
|
self.windowLevel = -1.0
|
|
self.rootViewController = UIViewController()
|
|
self.addSubview(self.textField)
|
|
}
|
|
|
|
required public init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
public func acquireFirstResponder() {
|
|
textField.becomeFirstResponder()
|
|
}
|
|
}
|