hsusmita
hsusmita

Reputation: 282

While pasting text to UITextView, textViewDidChange: is not getting called

I have a UITextView. I am resizing the text view based on the size of the text inside the method textViewDidChange. This works fine when I type. But this does not get calls when I paste something. Is it expected behavior or am I missing something?

Upvotes: 3

Views: 2091

Answers (1)

carlos16196
carlos16196

Reputation: 706

Thats because pasting a text will not call textViewDidChange, but instead will call shouldChangeTextInRange.

What i do is detect if a text is being pasted, then call the methods i use to resize the textView. So in ur shouldChangeTextInRange delegate you will have similar to my answer in:

how to know when text is pasted into UITextView

Upvotes: 1

Related Questions