如何获得UITableViewCell移动开始和结束的通知 [英] How to get notified of UITableViewCell move start and end
本文介绍了如何获得UITableViewCell移动开始和结束的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的iOS应用中有一个UITableView会定期刷新。用户还可以随时移动tableview行(tableview始终处于编辑模式)。
I have a UITableView in my iOS app that gets refreshed periodically. The user is also able to move the tableview rows at all times (the tableview is always in editing mode).
我想在用户开始拖动时停止刷新计时器一行,并在删除行时再次启动它。
I want to stop the refresh timer when the user starts dragging a row and start it again when the row is dropped.
使用 moveRowAtIndexPath
,最后一部分应该很简单,但如何获得有关拖动开始的通知?
The last part should be easy with moveRowAtIndexPath
, but how to get notified about drag start?
谢谢!
推荐答案
您的UITableViewDelegate将收到以下通知以响应重新排序操作:
Your UITableViewDelegate will receive the following notifications in response to reordering actions:
- (void)tableView:(UITableView *)tableView willBeginReorderingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView *)tableView didEndReorderingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView *)tableView didCancelReorderingRowAtIndexPath:(NSIndexPath *)indexPath;
这篇关于如何获得UITableViewCell移动开始和结束的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文