I spent a couple of days already googling for docs, examples or like this, but I can't find answer for my question.
I need to show some additional content for each message, under the text area, like on this picture (I can't embed it into the post).
So, what I tried to do is to register a supplementary view in messagesCollectionView
:
let nibName = String(describing: MessageBottomView.self)
let nib = UINib(nibName: nibName, bundle: nil)
self.messagesCollectionView.register(
nib,
forSupplementaryViewOfKind: nibName,
withReuseIdentifier: nibName
)
and then to dequeue it in MessagesDisplayDelegate
:
func messageFooterView(for indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> MessageReusableView {
let nibName = String(describing: MessageBottomView.self)
return messagesCollectionView.dequeueReusableSupplementaryView(
ofKind: nibName,
withReuseIdentifier: nibName,
for: indexPath
) as! MessageBottomView
}
But I don't see my view under messages.
So my question is why? And which way I have to be looking for in case of I'm doing something wrong.
Unfortunately the documentation of MessageKit
is not so informative, as it might be, and there is no similar question, or I can't find them at least, possibly because I even don't know which keywords I should search for.