New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
textView(_:shouldChangeTextIn:replacementString:) not been called #65
Comments
@wonderhero please check out this PR and let me know if it solves your problem. #66 |
@szweier I have tested the code and tried to step into the implementation. The defer statement still not getting called. Would you mind to have a check on this again? |
@wonderhero are other delegate methods being called? I find it strange that the defer wouldn’t be hit. Any chance you can push a sample app to a public repo that demonstrates this problem? |
@szweier yes, other delegate methods working well. Only textView(_:shouldChangeTextIn:replacementString:) not been called. Let me try setup a sample app for this. |
@wonderhero I just placed the following code into the
And it appears to be getting called (print statement is shown in console). It is worth noting that, due to the way the listener works, what you return from this method is ignored. |
@szweier I have setup a sample project to test this. Would you mind to check it out? https://github.com/wonderhero/SampleMentionApp If I paste a text into the textview. The print text won't get executed.
|
@szweier You are right, I have tested it. The listener is working. It is my bad. |
In my case I forgot to initialize listener with viewController delegate |
Hi szweier,
I have added SZMentionsListener in my code. I also implemented textView(_:shouldChangeTextIn:replacementString:) in my controller. I realised that if I paste string from external app into the textview that has implemented this library. My callback not getting called. I have stepped into the library code.
The delegate callback will not get called if it fulfilling the text pasting action. However, I need to do some adjustment to my UITextView (To resize the UI) if received the callback.
Is there any way I can get my delegate get called in the event of pasting text?
The text was updated successfully, but these errors were encountered: