I've watched a couple WWDC videos and I'm looking at the docs here: https://developer.apple.com/documentation/uikit/views_and_controls/collection_views/supporting_drag_and_drop_in_collection_views
I'm trying to implement dropping one item (a "file") unto another item (a "folder"), to move it into the folder. In my `collectionView(_:performDropWith)` I have:
moveItemsInModel()
collectionView.deleteItems(at: [indexPathOfMovedFile])
let newDestinationIndexPath = // ... get index path for destination "folder" item in current model
let item = coordinator.items.first!.dragItem
let cell = collectionView.cellForItem(at: newDestinationIndexPath)! // This seems to work, gets the right cell
let imageView = cell.viewWithTag(self.imageViewTag) as! UIImageView
let rect = cell.convert(imageView.bounds, from: imageView)
coordinator.drop(item, intoItemAt: newDestinationIndexPath, rect: rect)
My problem is that that last "drop" animation is animating to where it _was_. So if I move a file from before the folder, the animation slides the folder over and then drops to where it used to be.
How do you do this? Is there example code somewhere?