forked from shadowfacts/Tusker
Enable data detectors on main status text view
Tapping detected items doesn't work because it conflicts with our tap gesture recognizer, but long pressing does
This commit is contained in:
parent
5a5364ad3b
commit
f96d1d780c
|
@ -270,8 +270,9 @@ class ContentTextView: LinkTextView, BaseEmojiLabel {
|
||||||
|
|
||||||
extension ContentTextView: UITextViewDelegate {
|
extension ContentTextView: UITextViewDelegate {
|
||||||
func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
|
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
|
// generally disable the text view's link interactions, we handle tapping links ourself with a gesture recognizer
|
||||||
return false
|
// 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,10 @@ class ConversationMainStatusTableViewCell: BaseStatusTableViewCell {
|
||||||
]
|
]
|
||||||
|
|
||||||
contentTextView.defaultFont = .systemFont(ofSize: 18)
|
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))
|
profileDetailContainerView.addInteraction(UIContextMenuInteraction(delegate: self))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue