2021年1月16日星期六

Inserting text into textView by a button and then deleting

For example, I have a textview and a button above the textview. I'm not a native English speaker and when I type "아아아아아" into the textView and then touch the input button three times, the text in the textView will become "아아아아아aaa" and if I delete one of the "a"s the text in the textView becomes "아아아아아a앙". I expect it to be "아아아아아aa". 아 consists of "ㅇ"+"ㅏ" which are a constant and a vowel.

Would anyone let me know what I'm doing wrong?

It appears that only when I type that happens. It doesn't seem like it happens after I paste 아아아아아 and insert "aaa" and delete one of the "a"s. And when I type only constants "ㅇㅇㅇㅇㅇ" and then add "aaa", it works well. And it also works well when I type in English and then add "aaa".

import UIKit    class ViewController: UIViewController {      @IBOutlet weak var input: UIButton!            @IBAction func input(_ sender: Any) {          textViewTest.insertText("a")      }            @IBOutlet weak var textViewTest: UITextView!      override func viewDidLoad() {          super.viewDidLoad()          textViewTest.backgroundColor = .green      }  }  
https://stackoverflow.com/questions/65756839/inserting-text-into-textview-by-a-button-and-then-deleting January 17, 2021 at 10:44AM

没有评论:

发表评论