Set MessageCellDelegate and fix broken gestures

This commit is contained in:
Steven Deutsch
2017-09-17 19:15:30 -05:00
parent 499cdedfa0
commit ba0ef1678e
2 changed files with 5 additions and 2 deletions
+5 -1
View File
@@ -112,7 +112,10 @@ open class MessageCollectionViewCell<ContentView: UIView>: UICollectionViewCell
public func configure(with message: MessageType, at indexPath: IndexPath, and messagesCollectionView: MessagesCollectionView) {
// TODO: - fix delegate
// Check if delegate has already been set to reduce number of assignments
if delegate == nil, let cellDelegate = messagesCollectionView.messageCellDelegate {
delegate = cellDelegate
}
if let displayDelegate = messagesCollectionView.messagesDisplayDelegate {
@@ -146,6 +149,7 @@ open class MessageCollectionViewCell<ContentView: UIView>: UICollectionViewCell
let messageTapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapMessage))
messageContainerView.addGestureRecognizer(messageTapGesture)
messageContainerView.isUserInteractionEnabled = true
self.messageTapGesture = messageTapGesture
let topLabelTapGesture = UITapGestureRecognizer(target: self, action: #selector(didTapTopLabel))
-1
View File
@@ -30,7 +30,6 @@ open class TextMessageCell: MessageCollectionViewCell<MessageLabel> {
override open weak var delegate: MessageCellDelegate? {
didSet {
print("Fix this never gets set")
messageContentView.delegate = delegate
}
}