Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger textViewdelegate on programmatical UITextView edits

If I am typing with the keyboard, then textViewDidChange and shouldChangeTextInRange are always called. But when I change the textView programmatically, the delegate methods aren't called. How do I get a programmatic change in textView to trigger delegate methods?

Update

Is there some other way for simulating keyboard input programmatically?

like image 444
Katedral Pillon Avatar asked Sep 26 '14 09:09

Katedral Pillon


1 Answers

I solve this issue in my code using the insert method instead to change the value of the text string.

textView.insertText("Your Text")
like image 76
Maximo Lucosi Avatar answered Oct 10 '22 02:10

Maximo Lucosi