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

HPReorderTableView subclass shows a copy of the cell behind when the table view is its own data source #9

Open
dozel opened this issue Jul 8, 2014 · 4 comments
Labels

Comments

@dozel
Copy link

dozel commented Jul 8, 2014

Hey, firstly, thank you so much for this project, great time saver.

I subclassed the tableview so that I could reuse it later. Unfortunately this caused a funny side effect: when I am in reordering mode, the reordered cell leaves behind a copy of itself. So instead of the white empty cell, you actually see a copy of the cell. Do you know why this might happen?

I was able to get rid of this effect by not subclassing the tableview, but that way did not allow me to override functions like canMoveRowAtIndexPath or canEditRowAtIndexPath. Any help would be greatly appreciated. Thanks!

@hpique
Copy link
Owner

hpique commented Jul 9, 2014

Thanks @dozel. Can you provide a sample project with the error?

@dozel
Copy link
Author

dozel commented Jul 9, 2014

Hey @hpique , I've created a sample project you can download here:
https://dl.dropboxusercontent.com/u/16411938/ReorderTest.zip

@hpique
Copy link
Owner

hpique commented Jul 9, 2014

Thanks @dozel. The problem is not the subclass, but making the table view its own data source. Essentially, the tableView:cellForRowAtIndexPath: swizzle in HPReorderTableView (which is responsible for setting the empty cell) is not being called.

This looks like a bug. I'll look into it as soon as I return from vacation. In the meantime, you can simply let your view controller be the data source.

@hpique hpique added the bug label Jul 9, 2014
@hpique hpique changed the title Subclassing HPReorderTableView shows a copy of the cell behind. HPReorderTableView subclass shows a copy of the cell behind when the table view is its own data source Jul 9, 2014
@dozel
Copy link
Author

dozel commented Jul 9, 2014

When I do that, I cannot use certain methods like canMoveRowAtIndexPath. Do you know why that would happen?

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

No branches or pull requests

2 participants