Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation glitches when reordering cells of different size #26

Open
selasie opened this issue Apr 25, 2013 · 0 comments
Open

Animation glitches when reordering cells of different size #26

selasie opened this issue Apr 25, 2013 · 0 comments

Comments

@selasie
Copy link

selasie commented Apr 25, 2013

Hi, i've been using your layout for a while and encountered following problem:
Basically, I mimic table view via UICollectionView (cell width = screen width, no gaps between cells) to be able to reorder my cells -> but I need to display reordering control in a different location inside my custom cell, but, alas, UITableViewCell do not allow me to do this without some trickery.

I forked your repo here - selasie@a9dd083

And fixed following issue (although it might be specific to my project only, but it might help someone, someday):

When I reorder cells of different height (especially, when you drag cell with lesser height above cell with bigger height) there is a lot of glitches with inserting / deleting cells animation.
I restricted movement only to Y-axis (in handlePanRecoginzer: I use only y component of translation point), and modified invalidateLayoutIfNecessary method to handle following condition:
If we moving same direction (for now, I check only for vertical movement up and down) and trying to swap cells with index path similar to previously swapped cells (e.g. we swapped cells at indexes 0 and 1, and now trying to swap cell at index 1 with cell at index 0) - we assume that this scenario is wrong and do nothing, otherwise - continue swapping.

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

No branches or pull requests

1 participant