There is a func to change the return key type of the keyboard.
func refreshReturnKeyType() {
textView.resignFirstResponder()
textView.returnKeyType = .default
textView.reloadInputViews()
textView.becomeFirstResponder()
}
When i build this code with Xcode13, everything is fine. The returnKeyType can be changed smoothly, the keyboard is refreshed.
However, when i build this code with Xcode14 on an iOS16 iphone, there is some UI problem. The keyboard will draw back and then pop up again. Obviously, resignFirstResponder
makes the keyboard draw back and becomeFirstResponder
makes the keyboard pop up.
Has anyone ever met this problem? how to fix it? Thanks!
- Xcode13 - iOS15 - fine
- Xcode13 - iOS16 - fine
- Xcode14 - iOS15 - fine
- Xcode14 - iOS16 - not fine
Xcode14.2 is the same as Xcode14.1