twitter / TwitterTextEditor

A standalone, flexible API that provides a full-featured rich text editor for iOS applications.
Apache License 2.0
2.98k stars 164 forks source link

Access UITextViewDelegate method shouldInteractWithURL #22

Open richard-ash opened 2 years ago

richard-ash commented 2 years ago

I'm looking to interact with UITextViewDelegate method func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool. Specifically say there's highlighted text such as a mention or a hashtag as part of the attributed string. If the user taps that text we'd want to route them to a page with the associated information.

Is this possible? Or am I missing an alternative way to implement this behavior?

And awesome job with this framework! Love the simplicity and safety of the API's it's been fun to try it out over the last couple weeks : )