T
T
tiger_132021-02-08 23:00:15
Swift
tiger_13, 2021-02-08 23:00:15

How to handle click on anchor link in UITextView?

I am using UITextView to display html text.

textView.isEditable = false
textView.isSelectable = true
textView.dataDetectorTypes = .link
textView.delegate = self

textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool
implemented, standard links, for example , arrive in the delegate, but anchor links do not arrive in the delegate. How to process them? Perhaps someone faced such a problem? Or does UITextView not recognize anchors as links? <a href="https://example.com">ссылка</a><a href="#info2">ссылка</a>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question