Add accessoryButton action support

This commit is contained in:
Denis 2019-05-27 11:01:35 +03:00
parent 00de0cd809
commit 959032a03f
2 changed files with 6 additions and 0 deletions

View File

@ -355,6 +355,11 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
open func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { 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]) invoke(action: .move, cell: tableView.cellForRow(at: sourceIndexPath), indexPath: sourceIndexPath, userInfo: [TableKitUserInfoKeys.CellMoveDestinationIndexPath: destinationIndexPath])
} }
open func tableView(_ tableView: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {
let cell = tableView.cellForRow(at: indexPath)
invoke(action: .accessoryButtonTap, cell: cell, indexPath: indexPath)
}
} }
// MARK: - Sections manipulation // MARK: - Sections manipulation

View File

@ -80,6 +80,7 @@ public enum TableRowActionType {
case canMove case canMove
case canMoveTo case canMoveTo
case move case move
case accessoryButtonTap
case custom(String) case custom(String)
var key: String { var key: String {