How to handle delete action in JSQMessageController, I have implemented method
override func collectionView(collectionView: JSQMessagesCollectionView!, didDeleteMessageAtIndexPath indexPath: NSIndexPath!) {
self.collectionView?.deleteItemsAtIndexPaths([indexPath])
}
Also override method
override func collectionView(collectionView: UICollectionView, shouldShowMenuForItemAtIndexPath indexPath: NSIndexPath) -> Bool {
// Do the custom JSQM stuff
super.collectionView(collectionView, shouldShowMenuForItemAtIndexPath: indexPath)
// And return true for all message types (we don't want the long press menu disabled for any message types)
return true
}
override func collectionView(collectionView: UICollectionView, canPerformAction action: Selector, forItemAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) -> Bool {
super.collectionView(collectionView, canPerformAction: action, forItemAtIndexPath: indexPath, withSender: sender)
return true
}
override func collectionView(collectionView: UICollectionView, performAction action: Selector, forItemAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) {
super.collectionView(collectionView, performAction: action, forItemAtIndexPath: indexPath, withSender: sender)
}
but I get crash on menu item what else to be done to work, any help would be appreciated, thanks in advance.