Search code examples
iosswiftuitextviewios9

Change in UITextView return key types does not display on iOS 9


While my textView is being edited with keyboard showing, I am changing the keyboard return key type from "Send" to "Default".

textView.returnKeyType = .default
textView.reloadInputViews()

This works fine on iOS 10+ but iOS 9 does not display the changed return key.


Solution

  • Fixed it by doing this after changing the return key type:

    textView.resignFirstResponder()
    textView.becomeFirstResponder()