{"action":"created","issue":{"url":"https://api.github.com/repos/MessageKit/MessageKit/issues/706","repository_url":"https://api.github.com/repos/MessageKit/MessageKit","labels_url":"https://api.github.com/repos/MessageKit/MessageKit/issues/706/labels{/name}","comments_url":"https://api.github.com/repos/MessageKit/MessageKit/issues/706/comments","events_url":"https://api.github.com/repos/MessageKit/MessageKit/issues/706/events","html_url":"https://github.com/MessageKit/MessageKit/issues/706","id":327463088,"node_id":"MDU6SXNzdWUzMjc0NjMwODg=","number":706,"title":"Delete message by long press on cell ?","user":{"login":"JulienLevallois","id":5727223,"node_id":"MDQ6VXNlcjU3MjcyMjM=","avatar_url":"https://avatars1.githubusercontent.com/u/5727223?v=4","gravatar_id":"","url":"https://api.github.com/users/JulienLevallois","html_url":"https://github.com/JulienLevallois","followers_url":"https://api.github.com/users/JulienLevallois/followers","following_url":"https://api.github.com/users/JulienLevallois/following{/other_user}","gists_url":"https://api.github.com/users/JulienLevallois/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienLevallois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienLevallois/subscriptions","organizations_url":"https://api.github.com/users/JulienLevallois/orgs","repos_url":"https://api.github.com/users/JulienLevallois/repos","events_url":"https://api.github.com/users/JulienLevallois/events{/privacy}","received_events_url":"https://api.github.com/users/JulienLevallois/received_events","type":"User","site_admin":false},"labels":[{"id":649037381,"node_id":"MDU6TGFiZWw2NDkwMzczODE=","url":"https://api.github.com/repos/MessageKit/MessageKit/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-29T19:51:54Z","updated_at":"2018-06-01T16:19:12Z","closed_at":null,"author_association":"NONE","body":"Hi ! I want to delete message by long press gesture on cell.\r\nCurrently i can copy the message, how can i implement the possibility of add one action ?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/MessageKit/MessageKit/issues/comments/393931457","html_url":"https://github.com/MessageKit/MessageKit/issues/706#issuecomment-393931457","issue_url":"https://api.github.com/repos/MessageKit/MessageKit/issues/706","id":393931457,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzkzMTQ1Nw==","user":{"login":"Luke47","id":5190003,"node_id":"MDQ6VXNlcjUxOTAwMDM=","avatar_url":"https://avatars0.githubusercontent.com/u/5190003?v=4","gravatar_id":"","url":"https://api.github.com/users/Luke47","html_url":"https://github.com/Luke47","followers_url":"https://api.github.com/users/Luke47/followers","following_url":"https://api.github.com/users/Luke47/following{/other_user}","gists_url":"https://api.github.com/users/Luke47/gists{/gist_id}","starred_url":"https://api.github.com/users/Luke47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Luke47/subscriptions","organizations_url":"https://api.github.com/users/Luke47/orgs","repos_url":"https://api.github.com/users/Luke47/repos","events_url":"https://api.github.com/users/Luke47/events{/privacy}","received_events_url":"https://api.github.com/users/Luke47/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T16:19:12Z","updated_at":"2018-06-01T16:19:12Z","author_association":"NONE","body":"> I dont understand where i need to override this, and what i need to do, to have 2 buttons, copy & delete\r\n\r\nIn the subclass of `MessagesViewController`, for example for the \"delete\" action (pseudocode out of my head):\r\n\r\n```\r\nclass MyChatViewController: MessagesViewController {\r\n\r\noverride func collectionView(_ collectionView: UICollectionView, canPerformAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) -> Bool {\r\n        \r\n        if action == #selector(UIResponderStandardEditActions.delete(_:)) {\r\n            return true\r\n        }\r\n        \r\n        return super.canPerformAction(action, withSender: sender)\r\n\r\n    }\r\n    \r\noverride func collectionView(_ collectionView: UICollectionView, performAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) {\r\n    \r\n        // Delete action should be handled by yourself\r\n        if action == #selector(UIResponderStandardEditActions.delete(_:)) {\r\n            // Remove entry from datasource\r\n           // Delete section of the collectionView\r\n        }\r\n        \r\n        // Use default handler instead\r\n        super.collectionView(collectionView, performAction: action, forItemAt: indexPath, withSender: sender)\r\n        \r\n    }\r\n\r\n}\r\n```"}}
{"actor":{"display_login":"Luke47"}}