0

Through adding the NSLinkAttributeName to my specific word, I make a clickable textView.

Use textView callback function, I can custom my action when the specific word is tapped.

Callback is below :

@available(iOS 10.0, *)
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {

    delegate?.viewNeedInfoWhenURLDidTapped(linkName: URL.absoluteString)

    return false
}

I found that clickable area in the textView is very strange and unpredictable.

Is that possible to expand the textView clickable area ?????

Thanks, really appreciate.

HungCLo
  • 442
  • 2
  • 6
  • 21
  • This may be helpful for you https://github.com/Jitu1990/link-clickable-Label – Jitendra Solanki Sep 05 '17 at 09:35
  • Refer the bellow URL. [https://stackoverflow.com/questions/39238366/uitextview-with-hyperlink-text](https://stackoverflow.com/questions/39238366/uitextview-with-hyperlink-text) – Bapu Sep 05 '17 at 10:25
  • Thanks @JitendraSolanki, in some reason, I think textView is what I need. – HungCLo Sep 06 '17 at 02:01

0 Answers0