Re-order custom layout with Dynamic sized cells in UICollectionView

Viewed 306

.

Hello, everyone!

So, I made a Custom Layout for my UICollectionView. This Custom Layout has support for dynamic cell sizing (just the width of the cell is changed).

Also, the UICollectionView has drag 'n drop to the user be able to reorder the cells.

  • With the dynamic cell size off, the reorder works without any problem (GIF)
  • With the dynamic cell size on, the reorder has some issues during the dragging animation (like this).

The example project is in this Github repository:

https://github.com/rgipd/uicollectionview-reorder-error

The Github's README.md file has all the errors listed as well.

I already read some blog and answers, like this one:

https://nshint.github.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/

Also, I did implement the invalidationContextForInteractivelyMovingItems... method, but, even with the NSHint example (that you can download) in the article, when you drag a small cell to occupy the space of larger cell, some cells are replaced and errors appears! Also, the cells stay swapping with cursor at middle because the hard-coded call to moveAt method (probably). The problem in the article's author example is in the Github repository's Wiki:

https://github.com/rgipd/uicollectionview-reorder-error/wiki/NSHint-reorder-collection-view-error

Anyone can help me out with this issue?

Thanks in advance!

UPDATE: 28 July 2020 Nothing new. Can't do it with simple horizontal UICollectionView Custom Layout as well.

0 Answers
Related