Which notification triggers textViewDidChange?

217 Views Asked by At

I believe the notification

UITextView.textDidChangeNotification

is what triggers

textViewDidChangeSelection(_ textView: UITextView)

to run.

However it does not trigger

 textViewDidChange(_ textView: UITextView)

to run.

In fact which is "the" notification which triggers textViewDidChange to run?

1

There are 1 best solutions below

2
Alan S On

I'm not sure firsthand how to answer your question, but the documentation states the following:

The text view calls this method in response to user-initiated changes to the text. This method is not called in response to programmatically initiated changes.

Implementation of this method is optional.

From here: Text View Did Change Documentation