I am using https://github.com/jessesquires/JSQMessagesViewController/issues/1820 this library for chat application. By using this libary I am able to send images and video,
I would suggest that you create your own custom view for this. You can use the JSQIncomingCollectionViewCell.xib
or JSQOutgoingCollectionViewCell.xib
as a template for your self.
CellWithConfimationButtons
In your ChatViewController i.e. what ever you called the view that is a subclass of 'JSQMessagesViewController'. Add these two lines
self.collectionView.registerNib(UINib(nibName: "CellWithConfimationButtons", bundle: nil), forCellWithReuseIdentifier: "incomingCell") self.collectionView.registerNib(UINib(nibName: "CellWithConfimationButtons", bundle: nil), forCellWithReuseIdentifier: "outgoingCell")
Now you can add your buttons to the xib files
Add Constraints so that it lays its self out right.
Set your Images for those and then you need to make your files that support this guy. Just like JSQMessagesCollectionViewCellOutgoing.m
and JSQMessagesCollectionViewCellOutgoing.h
Then you need to add you IBOutlets
for the buttons and add the actions and logic in that file
Then you need to set a flag or some way of determining that the message is this type of message with buttons.
collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath)
you check for that flag and get your cell
if message.flag == true let cell = collectionView.dequeableCellWithIdentifier("incomingCell")
Then set everything up.
I hope that helps. let me know if I can help more.