LXReorderableCollectionViewFlowLayout icon indicating copy to clipboard operation
LXReorderableCollectionViewFlowLayout copied to clipboard

Why not move instead of insert/delete?

Open hpique opened this issue 11 years ago • 5 comments

Any reason for not using moveItemAtIndexPath:toIndexPath: instead of insert/delete here?

Move appears to be a little bit more efficient. Also, it would make the block unnecessary.

hpique avatar Mar 31 '13 19:03 hpique

There are already some animation issues that I haven't been able to fix. The reason, I suspect, is that delete and insert is just a shorter animation. With a batch, it's basically the same thing.

lukescott avatar Mar 31 '13 19:03 lukescott

If there's a reason, please consider adding a comment. If not it looks arbitrary, and prone to accidental changes.

hpique avatar Apr 01 '13 08:04 hpique

I couldn't remember why but from my test it seems to shows that using insert/delete provides a more consistent effect. If I'm not guessing wrongly its something related to #17. I'll remember to put a comment when I get to that issue. :)

lxcid avatar Apr 01 '13 15:04 lxcid

That's a new issue. With the insert/delete or move, the issue is still the same. On my fork I have an experimental patch that either forces a layout change, or does a pre-batch update with nil. Both cancel the animation. Even with that, it doesn't completely fix it as there are other issues.

The insert/delete animation just causes one card to fade out and another to fade in. The move animation actually moves the card, which isn't desirable because you're actually holding the card.

lukescott avatar Apr 01 '13 16:04 lukescott

Oh yeah @lukescott's explanation does ring some bells. I saw your experiment branch the other day. When I'm at this issue I will definitely pull down and see if I can get any progression on it, although it might take some time though.

lxcid avatar Apr 01 '13 17:04 lxcid