开发者

How to forbid the movement between 2 UITableViewCells in different section in same UITableView

I have a UITableView with 2 sections. The UITableCells in the same section can be mov开发者_StackOverflow中文版ed. But I hope to forbid the movement between 2 UITableViewCells in different sections of a same UITableView. Is it possible?

Welcome any commnet

Thanks

interdev


In the tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:

if (proposedDestinationIndexPath.section == sourceIndexPath.section)
    return sourceIndexPath;

This will cause the row to go back to it's source indexpath if the section that it's trying to move to, isn't the same section as it's original indexpath

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜