开发者

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

开发者 https://www.devze.com 2023-01-14 01:06 出处:网络
I have a UITableView with 2 sections. The UITableCells in the same section can be mov开发者_StackOverflow中文版ed.

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

精彩评论

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