When pasting text into UITextView, textViewDidChange: doesn't get called
I have a UITextView. I am resizing a text view based on the size of the text inside the textViewDidChange method. This works fine when I type. But these are not calls when I insert something. Expected behavior or am I missing something?
+3
hsusmita
source
to share
1 answer
Thats because inserting text will not call textViewDidChange, but will call shouldChangeTextInRange instead.
What I do is detect if text is inserted and then call the methods that I use to resize the textView. So in ur delegate shouldChangeTextInRange you will be like my answer in:
how to know when text is inserted into UITextView
0
carlos16196
source
to share