Open anoadragon453 opened 4 years ago
Message cells use UITextView that can detect automaticaly some data (like links) and convert them to URLs (see UITextView.dataDetectorTypes property documentation for more information).
The Apple link detector does not detect every kind of links and unfortunately we can't set a custom data detector to the UITextView
.
We have to manually detect custom links. To achieve this we plan to:
NSAttributedString
with NSAttributedString.Key.link attribute when a link is detected.NSAttributedString
.Note: Once it's all done it will also be possible to use UILabel
instead of UITextView
to display links. Handling tap gesture on it will be another subject.
Riot iOS is failing to turn links like
maunium.dev
into a link. Is there a list of known TLDs somewhere that Riot iOS uses, and if so can we use a regex instead (or does Apple provide an API or this)? As otherwise we'll always be out of date as new TLDs come out.Related: #772