Added support to move rows
This commit is contained in:
parent
9fff8c861c
commit
709f739ab6
|
|
@ -273,6 +273,10 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
|||
invoke(action: .clickDelete, cell: tableView.cellForRow(at: indexPath), indexPath: indexPath)
|
||||
}
|
||||
}
|
||||
|
||||
open func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
|
||||
invoke(action: .move, cell: tableView.cellForRow(at: sourceIndexPath), indexPath: sourceIndexPath, userInfo: [TableKitNotifications.CellMoveDestinationIndexPath: destinationIndexPath])
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Sections manipulation
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import UIKit
|
|||
|
||||
struct TableKitNotifications {
|
||||
static let CellAction = "TableKitNotificationsCellAction"
|
||||
static let CellMoveDestinationIndexPath = "TableKitCellMoveDestinationIndexPath"
|
||||
}
|
||||
|
||||
public protocol RowConfigurable {
|
||||
|
|
@ -65,6 +66,7 @@ public enum TableRowActionType {
|
|||
case height
|
||||
case canEdit
|
||||
case configure
|
||||
case move
|
||||
case custom(String)
|
||||
|
||||
var key: String {
|
||||
|
|
|
|||
Loading…
Reference in New Issue