Commit e116314a authored by Alex朱枝文's avatar Alex朱枝文

赴港计划书 解决98个字符输入拼音 nihao没法选中‘你好’输入的问题

parent 4a480e08
......@@ -492,9 +492,13 @@ extension YHHKPlanItemView : UITextViewDelegate {
if text.isEmpty {
return true
}
let tempTxt = textView.text + text
let newLength = calcTextLength(string: tempTxt)
// 使用 NSString 来处理文本替换
let nsString = textView.text as NSString
let newText = nsString.replacingCharacters(in: range, with: text)
let newLength = calcTextLength(string: newText)
// let tempTxt = textView.text + text
// let newLength = calcTextLength(string: tempTxt)
return newLength <= maxNumbler
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment