Custom UITableView reorder

后端 未结 3 1998
粉色の甜心
粉色の甜心 2021-02-04 18:03

I\'m wondering if anyone has a link to a good tutorial or can point me in the right direction to recreate the \'drag to reorder\' cells in a UITableView like Epic Win App. The

3条回答
  •  你的背包
    2021-02-04 18:28

    It is pretty straight forward - which is probibly why there is no explicit tutorial on the matter.

    Just create the UITableView normally, but set the showsReorderControl of each cell to TRUE. When you go into editing mode (normally by pressing the "edit" button and setting the "Editing" value of the UITableView to TRUE) - the reorder bars will appear in the cells.

    Note:

    If your data source implements tableView:canMoveRowAtIndexPath: - and it returns "NO" - the reorder bars will not appear.

    You will also need to implement –tableView:moveRowAtIndexPath:toIndexPath: in the data source delegate.

提交回复
热议问题