New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete message by long press on cell ? #706
Comments
@JulienLevallois You should be able to make
Then implement it here:
|
I dont understand where i need to override this, and what i need to do, to have 2 buttons, copy & delete |
In the subclass of
|
Okay, forget my previous comment. I just tested it and it does not seem to work. I will try to get it working (as I also need custom actions) and report back :) |
Okay, so @JulienLevallois here is a working example. You need to
2.) Also you need to write an extension to the class of the
That is the easiest way that I have found, I hope it helps! Update: The code above is meant for system actions like copy or delete. In order to add custom actions, just follow the same scheme, but add your custom actions also to the UIMenuController, like so:
Of course add the custom actions also to
|
This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@Luke47 thank you very much :) |
@JulienLevallois you need to delete the message from your datasource as he commented in the code. Sent with GitHawk |
Glad this one could be resolved! Thanks everyone 😃 Sent with GitHawk |
@kpsdeveloper You'll have to look at my comment above in this thread. This is a general iOS question and not really related to MessageKit 😢 |
@Luke47 I tried your answer, but my i couldn't get my delete action to do anything, not even a print statement. in other words, the delete action isn't called but it shows with the copy. any idea what might be wrong? |
Okay this works, the issue i have with this now is in this |
@nathantannar4 I did |
Hi, solution Luke gave seems like for deleting message from both sides. I need to implement deleting for only user who deletes it. So other person can still see the message like in whatsapp. |
#706 (comment) Thankyou. |
I added the code from @Luke47 and it's working very well for texts and images. But it's not working at all for video messages. Do you have any suggestions? |
Use messageKit with Firebase When I delete any message in the chat using long press, it gets deleted in front of me, but when I leave the chat and come back, it is not actually deleted. animation.mp4` override func collectionView(_ collectionView: UICollectionView, performAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) {
|
Does anyone know where I can implement "extension MessageCollectionViewCell"? |
But how to add more button after long press? |
Hi ! I want to delete message by long press gesture on cell.
Currently i can copy the message, how can i implement the possibility of add one action ?
Thanks
The text was updated successfully, but these errors were encountered: