1

I am using MessageKit to implement the Chat UI for my App. I have added an icon in AccessoryView using configureAccessoryView method. Also, I implemented didTapAccessoryView from MessageCellDelegate. But the method is not getting called while didTapMessage is getting called perfectly.

Here is my code snippets for MessageCellDelegate

extension MessagingController: MessageCellDelegate {
    func didTapAccessoryView(in cell: MessageCollectionViewCell) {
        print("didTapAccessoryView view tapped")
    }
    
    func didTapMessage(in cell: MessageCollectionViewCell) {
        print("didTapMessage view tapped")
    }
}

Here is my code for collectionView setup

messagesCollectionView.messagesDataSource = self
        messagesCollectionView.messageCellDelegate = self
        messagesCollectionView.messagesLayoutDelegate = self
        messagesCollectionView.messagesDisplayDelegate = self
Ahsan Aasim
  • 1,177
  • 3
  • 14
  • 40
  • Code snippet for added view? – tanmoy Jun 02 '22 at 07:29
  • Check this snippet. https://github.com/MessageKit/MessageKit/blob/main/Example/Sources/View%20Controllers/AdvancedExampleViewController.swift – tanmoy Jun 02 '22 at 07:31
  • The added view should have `isUserInteractionEnabled = false` to respond to accessoryView tap through `MessageCellDelegate`. Let me know the result. – tanmoy Jun 02 '22 at 07:32

0 Answers0