Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

reloadData issue #35

Open
WitzHsiao opened this issue Feb 21, 2014 · 8 comments
Open

reloadData issue #35

WitzHsiao opened this issue Feb 21, 2014 · 8 comments

Comments

@WitzHsiao
Copy link

This is a very weird issue.
It works fine in simulator, but not do the same in real iPhone.

I used [collectionView reloadData]; in didMoveItemAtIndexPath, but just the only cell which I moved refreshed. others cell didn't refresh.

please help me, thanks!

@wiruzx
Copy link

wiruzx commented Mar 19, 2014

iOS simulator doesn't reuse cells. I think the bug is hidden here.

@wiruzx
Copy link

wiruzx commented Mar 19, 2014

Alright, it's a little bit tricky, but works for me:
The point is calling reloadData after some amount of time.

[collectionView performSelector:@selector(reloadData) withObject:nil afterDelay:0.3];

I don't know, why it works, maybe @lukescott will figure it out.

@lukescott
Copy link
Owner

The didMoveItemAtIndexPath feature was added by @ndlupine. Looking at it, it may be because didMoveItemAtIndexPath is called inside the completion handler of performBatchUpdates. That code probably should be inside the completion handler of animateWithDuration after invalidateLayout.

If someone wants to debug this and see if moving the code solves the problem, send me a pull request and I'll merge it.

@wiruzx
Copy link

wiruzx commented Mar 20, 2014

Nope, unfortunately it doesn't help. Exactly same behaviour.

@WitzHsiao
Copy link
Author

I found a very tricky thing, not sure if there is helpful.
If I dragged it and then there got issue. and if I try press any cell a while, and just release it, don't move it. Then all cells are got reload.

@mplackowski
Copy link

"Nope, unfortunately it doesn't help. Exactly same behaviour." ~wiruzx

Well, I have checked that too, and in my project it works as expected. Cells are reloaded properly.

@martinlockett
Copy link

I see this problem if I flick an item to another location in the UICollectionView

@martinlockett
Copy link

PR #42 fixes this (or will when it's merged)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants