adding a trash can in bottom of view in order to delete items
roiholtzman opened this issue · 3 comments
Is there a way to add a trash can at the bottom of the view so that when an item is being dragged on it, the item will be deleted from the array? Thanks for the help.
Unfortunately, currently this library doesn't do that out of the box, but technically you can achieve it with some modifications.
Can you maybe give me a pointer on what to do?
These 2 lines query the collection view for the index the current selection is over on, what you could do is before this query, see if you are over trash can. If you are, you might want to update the collection view state to reflect the changes. If not, just let the system continue to manage the reordering behavior. You probably want to expands the delegate system to keep your codebase clean, unless those behaviour are general enough.
Note that this is a pretty tight loop so keep thing short. :)