iOS 12, Xcode 10.1. I've got a view that has a UITextField
. Delegate connection is hooked up to the view controller in the Storyboard. I've done this a hojillion times before.
I want to send the first responder to the next field when Return is hit on the keyboard, so the correct way to do it is like so:
extension SignInViewController: UITextFieldDelegate {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
switch textField {
case loginEmailField:
loginPasswordField.becomeFirstResponder()
case loginPasswordField:
loginPasswordField.resignFirstResponder()
signInTapped(sender: UIButton())
default: break
}
return true
}
}
With a hardware keyboard attached, either with my iPad Pro with Keyboard Case, or on my Mac with the Simulator, the delegate method doesn't fire. Bring up the on-screen keyboard, and it works perfectly.
I've implemented similar things before, and I've been wracking my brain to see any differences between them, to no avail. What potential causes can I look at to resolve this, and get hardware keyboards' Return keys to function?