Allow tapping anywhere on verification code view to make first responder
This commit is contained in:
parent
d0e0738701
commit
2fddccb8e3
@ -140,6 +140,8 @@ class RegistrationVerificationCodeView: UIView {
|
||||
self.addSubview(textfield)
|
||||
|
||||
updateColors()
|
||||
|
||||
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapView)))
|
||||
}
|
||||
|
||||
public func updateColors() {
|
||||
@ -202,6 +204,11 @@ class RegistrationVerificationCodeView: UIView {
|
||||
textfield.selectedTextRange = textfield.textRange(from: newPosition, to: newPosition)
|
||||
}
|
||||
|
||||
@objc
|
||||
private func didTapView() {
|
||||
becomeFirstResponder()
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
public override func becomeFirstResponder() -> Bool {
|
||||
return textfield.becomeFirstResponder()
|
||||
|
||||
@ -214,11 +214,7 @@ class RegistrationVerificationViewController: OWSViewController {
|
||||
public override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
if !UIDevice.current.isIPhone5OrShorter {
|
||||
// Small devices may obscure parts of the UI behind the keyboard, especially with larger
|
||||
// font sizes.
|
||||
verificationCodeView.becomeFirstResponder()
|
||||
}
|
||||
verificationCodeView.becomeFirstResponder()
|
||||
|
||||
showValidationErrorUiIfNecessary()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user