UICollectionView stops loading cells after moveItemAtIndexPath: toIndexPath:

I have a UICollectionView

c UICollectionViewFlowLayout

that contains a lot of items. I want to reorder a cell due to user input.

[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath];

      

After running this code, browsing the collection does not update its content on scrolling . It doesn't show the following cells. It doesn't even call cellForItemAtIndexPath:

, but the content is sized correctly (the layout "updates" its state). Therefore, we can only see the cells that were allocated in the collection view before the reordering. Any clues what the problem might be? Are there any known solutions to this problem? The app is iOS 8 only and the collection view is used with UICollectionViewFlowLayout.

EDIT: When I call [self.collectionView reloadData];

, the datasource doesn't even ask for anything.

+3


source to share


1 answer


The problem was with UICollectionViewCell

. The high level description is that the cell is dispatched by a method actionForKey

from my code during a move animation. This caused the cell to remain in an internal state being animated

. I couldn't find a sensible solution and edited some bits to avoid the call actionForKey

. Everything now works as expected.



0


source







All Articles