cjwirth / RichEditorView

RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.
BSD 3-Clause "New" or "Revised" License
1.9k stars 445 forks source link

shouldChangeTextInRange:(NSRange) Delegate? #141

Closed xiaosongshu closed 6 years ago

xiaosongshu commented 6 years ago

Is there a way to implement a delegate similar to UITextView's

  • (BOOL)textView:(UITextView )textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString )text

Using for autocorrect manipulation

cjwirth commented 6 years ago

This is something I wanted to add from the beginning. I don't think there is a good way to do it, unfortunately. The reason being that the JS callback doesn't get called until the text is already added in. Sorry!

If you come up with something that works well, I'd like to know, so feel free to open a pull request if you do.