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.