how to perform a custom move of UITableViewCell?

ε祈祈猫儿з 提交于 2019-12-12 18:46:04

问题


I want to move cells just as these two methods do:

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath;
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath;

Before I use these methods above to move cells (by user's touch action), tableView's setEditing:animated: must be called first.

But what I want is user long press then drag a cell to move it without entering editing style, and i hope these moving view won't appear in cells' right, like this:

Any suggestion? Special thx!


回答1:


One solution: http://b2cloud.com.au/how-to-guides/reordering-a-uitableviewcell-from-any-touch-point

but it can't use long press gesture to begin draging

And we can use FMMoveTableView to do this.



来源:https://stackoverflow.com/questions/11211350/how-to-perform-a-custom-move-of-uitableviewcell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!