diff --git a/Tusker/Views/ContentTextView.swift b/Tusker/Views/ContentTextView.swift index 8f47a1ae..27de5184 100644 --- a/Tusker/Views/ContentTextView.swift +++ b/Tusker/Views/ContentTextView.swift @@ -270,8 +270,9 @@ class ContentTextView: LinkTextView, BaseEmojiLabel { extension ContentTextView: UITextViewDelegate { func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool { - // disable the text view's link interactions, we handle tapping links ourself with a gesture recognizer - return false + // generally disable the text view's link interactions, we handle tapping links ourself with a gesture recognizer + // the builtin data detectors use the x-apple-data-detectors scheme, and we allow the text view to handle those itself + return URL.scheme == "x-apple-data-detectors" } } diff --git a/Tusker/Views/Status/ConversationMainStatusTableViewCell.swift b/Tusker/Views/Status/ConversationMainStatusTableViewCell.swift index e861e721..ee447bcb 100644 --- a/Tusker/Views/Status/ConversationMainStatusTableViewCell.swift +++ b/Tusker/Views/Status/ConversationMainStatusTableViewCell.swift @@ -50,6 +50,10 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell { ] contentTextView.defaultFont = .systemFont(ofSize: 18) + contentTextView.dataDetectorTypes = [.flightNumber, .address, .shipmentTrackingNumber, .phoneNumber] + if #available(iOS 16.0, *) { + contentTextView.dataDetectorTypes.formUnion([.money, .physicalValue]) + } profileDetailContainerView.addInteraction(UIContextMenuInteraction(delegate: self))