如何获得UITableViewCell移动开始和结束的通知? [英] How to get notified of UITableViewCell move start and end?

查看:87
本文介绍了如何获得UITableViewCell移动开始和结束的通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iOS应用中有一个UITableView,它会定期刷新。用户还可以随时移动表格视图行(表格视图始终处于编辑模式)。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆