如何获得 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屋!
查看全文