I have a UITextView in a TableViewCell and I wanted to enable data detection in the textView in order to show clickable links and Phone numbers. So I did this in storyBoard
These steps didn't work so I did the same in code.
@IBOutlet weak var postDescTextView: UITextView!
override func layoutSubviews() {
super.layoutSubviews()
postDescTextView.isUserInteractionEnabled = true
postDescTextView.isSelectable = true
postDescTextView.dataDetectorTypes = .all
}
But none of the steps seems to work.
There is clearly something I'm doing wrong. I'm pretty sure the answer is a simple one. I've found some similar questions like these. Question 1 Question2
But unlike these questions, I don't want my TextView editable nor I don't want to be able to select The TableViewCell. Just need to make the Datalink detection work in a TableViewCell.