Implement tableView:canMoveRowAt:indexPath method
This commit is contained in:
parent
f05511cfba
commit
74af45f3cd
|
|
@ -307,6 +307,10 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
open func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
|
||||
return invoke(action: .canMove, cell: tableView.cellForRow(at: indexPath), indexPath: indexPath) as? Bool ?? true
|
||||
}
|
||||
|
||||
open func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
|
||||
invoke(action: .move, cell: tableView.cellForRow(at: sourceIndexPath), indexPath: sourceIndexPath, userInfo: [TableKitUserInfoKeys.CellMoveDestinationIndexPath: destinationIndexPath])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public enum TableRowActionType {
|
|||
case height
|
||||
case canEdit
|
||||
case configure
|
||||
case canMove
|
||||
case move
|
||||
case custom(String)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue