转载请声明出处:http://blog.youkuaiyun.com/jinnchang/article/details/45934781
1、前言
移动(order)实现以下方法:
// 设置哪些行可以被移动
func tableView(tableView: UITableView, canMoveRowAtIndexPath indexPath: NSIndexPath) -> Bool
// 设置移动操作
func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath)
编辑(delete、add)实现以下方法:
// 设置哪些行可以被编辑
func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool
// 设置编辑模式下每行左边显示的按钮样式
func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle
// 设置编辑操作(删除、插入)
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
// 设置滑动操作显示字样
func tableView(tableView: UITable