KDDragAndDropCollectionView: Dynamic cell size breaks dragging
I configured my collection view cells to calculate their height by overriding UICollectionViewCell.preferredLayoutAttributesFitting.
When I do this, dragging appears to break in a weird way. When I first drag an item from one collection view to another, the items in the collection view I’m dragging to all move down to make room for the cell I’m dragging, even though the cell I’m dragging barely even entered the other collection view. After about a second, the cells in the collection view I’m dragging to all re-arrange and go back to normal. At that point, I can drag the new cell into it’s position.
Any ideas on what this may be? I’ve spent the last two days trying to figure it out…
It seems to be something in the KDDragAndDropCollectionView.didMoveItem function.
Thanks.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (9 by maintainers)
Sure… so the only changes I did from you code: Create and outlet for one
UICollectionViewFlowLayout, give it an estimated item size (ViewController:41).That’s it…
So now the items will be the exact size they need to be, but now when dragging any item in the top collecitonview will result in strange animations
Thanks for having a look!
KDDragAndDropCollectionView-master-2.zip