summaryrefslogtreecommitdiff
path: root/Juick/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/Views')
-rw-r--r--Juick/Views/MessageCell.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/Juick/Views/MessageCell.swift b/Juick/Views/MessageCell.swift
index ebebec2..61867ce 100644
--- a/Juick/Views/MessageCell.swift
+++ b/Juick/Views/MessageCell.swift
@@ -14,7 +14,7 @@ import UIKit
}
@objc
-class MessageCell: UITableViewCell {
+class MessageCell: UITableViewCell, UITextViewDelegate {
@IBOutlet weak var avatar: UIImageView!
@IBOutlet weak var message: UITextView!
@IBOutlet weak var title: UILabel!
@@ -89,6 +89,7 @@ class MessageCell: UITableViewCell {
}
self.message.attributedText = nil
if (msg.text != nil) {
+ self.message.delegate = self
self.message.isHidden = false
self.message.isSelectable = selectable
self.message.isUserInteractionEnabled = selectable
@@ -159,6 +160,10 @@ class MessageCell: UITableViewCell {
self.delegate?.avatarClicked(name)
}
}
+ func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool {
+ self.delegate?.linkClicked(URL.absoluteString)
+ return false
+ }
@objc func linkClicked(_ sender: UITapGestureRecognizer){
self.delegate?.linkClicked(self.attachment!)
}