GrowingTextView
GrowingTextView copied to clipboard
输入问题
中文输入,输入一段后,直接是字母录入,如图.
估计跟替换内容有关吧?
Chinese IME (input method) like Pinyin(or any other IME need more than one type to input), use more than one type to input a single unicode character, for example type zi for 字,but this View will break the input to "zzi字" by mistake, so he guessed it is maybe something wrong with some replace function.
My own guess is something wrong with the textViewDidChange function
I added a log print in textViewDidChange
print("\(textView.text)")
here is what is showing in log on m1 macOS (hardware keyboard)
Optional("z")
Optional("zi")
Optional("字")
Optional("字")
Optional("字z")
Optional("字zzi")
Optional("字zzi字")
on iPhone with iOS 15.2 (soft keyboard)
Optional("z")
Optional("zi")
Optional("字")
Optional("字")
Optional("字z")
Optional("字zi")
Optional("字zii")
All input with keyboard is z i space z i space