How would one implement this feature? I have managed to highlight each individual url in the messages but how would I make each individual link independently tappable?
didTapMessage will not work for this since that applies to the entire message and I might have 8 urls in one message.
I guess that you already implemented the two delegate methods needed from MessagesDisplayDelegate to highlight and modify how URLs are shown:
func enabledDetectors(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> [DetectorType]
and
func detectorAttributes(for detector: DetectorType, and message: MessageType, at indexPath: IndexPath) -> [NSAttributedStringKey: Any]
So you just need to implement func didSelectURL(_ url: URL) from MessageCellDelegate to obtain the selected URL.
hmm so what exactly do I need to do to make the didSelectURL trigger when tapping a url?
SOLUTION
Put return [.url] in enabledDetectors
(the rest of the data is provided above and just recently this info has also been added to the example app)
How can I know own message of the detected url?
Most helpful comment
SOLUTION
Put
return [.url]inenabledDetectors(the rest of the data is provided above and just recently this info has also been added to the example app)