|
@@ -192,6 +192,11 @@ public class BaseMessageCell: UITableViewCell {
|
|
let messageLabelGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
|
|
let messageLabelGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
|
|
gestureRecognizer.numberOfTapsRequired = 1
|
|
gestureRecognizer.numberOfTapsRequired = 1
|
|
messageLabel.addGestureRecognizer(messageLabelGestureRecognizer)
|
|
messageLabel.addGestureRecognizer(messageLabelGestureRecognizer)
|
|
|
|
+
|
|
|
|
+ let quoteViewGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(onQuoteTapped))
|
|
|
|
+ quoteViewGestureRecognizer.numberOfTapsRequired = 1
|
|
|
|
+ quoteView.addGestureRecognizer(quoteViewGestureRecognizer)
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@objc
|
|
@objc
|
|
@@ -210,6 +215,12 @@ public class BaseMessageCell: UITableViewCell {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @objc func onQuoteTapped() {
|
|
|
|
+ if let tableView = self.superview as? UITableView, let indexPath = tableView.indexPath(for: self) {
|
|
|
|
+ baseDelegate?.quoteTapped(indexPath: indexPath)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// update classes inheriting BaseMessageCell first before calling super.update(...)
|
|
// update classes inheriting BaseMessageCell first before calling super.update(...)
|
|
func update(msg: DcMsg, messageStyle: UIRectCorner, isAvatarVisible: Bool, isGroup: Bool) {
|
|
func update(msg: DcMsg, messageStyle: UIRectCorner, isAvatarVisible: Bool, isGroup: Bool) {
|
|
if msg.isFromCurrentSender {
|
|
if msg.isFromCurrentSender {
|
|
@@ -430,4 +441,5 @@ public protocol BaseMessageCellDelegate: class {
|
|
func imageTapped(indexPath: IndexPath)
|
|
func imageTapped(indexPath: IndexPath)
|
|
func avatarTapped(indexPath: IndexPath)
|
|
func avatarTapped(indexPath: IndexPath)
|
|
func textTapped(indexPath: IndexPath)
|
|
func textTapped(indexPath: IndexPath)
|
|
|
|
+ func quoteTapped(indexPath: IndexPath)
|
|
}
|
|
}
|