3

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?

hsusmita
  • 282
  • 3
  • 16

1 Answers1

1

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

Community
  • 1
  • 1
carlos16196
  • 706
  • 1
  • 7
  • 10