Posts

Post not yet marked as solved
0 Replies
494 Views
I'm using a collection view with drag and drop enabled and am getting some weird behavior when I call reloadData() while I'm in the drag state after itemsForBeginning but before dragSessionWillBegin. This is when your finger has long pressed a cell, the lifting animation has completed, but you have not pulled the cell away from the collection view to begin a drag session in proper.While in this state, if you trigger a reloadData() in the collection view, the drag candidate cell will be visibly swapped out for another cell; another cell will jump underneath your finger. You can still drag the cell away to begin a drag session, but the UIDragItem passed to the UIDragSession will be that of the new swapped cell rather than the original. This happens whether you're implementing drag and drop with UICollectionViewDragDelegate on the collection view's view controller or with UIDragInteractionDelegate on each cell individually.Is there a fix for this issue, or an explanation as to why it occurs? It's become a pretty big problem in an app I'm working on. I've isolated it in a barebones test app to be sure it wasn't a unique issue to my own studio app. The swapping behavior is identical in both.
Posted
by tpiske.
Last updated
.