add id to action
This commit is contained in:
parent
c040613654
commit
5f6de4703a
|
|
@ -25,7 +25,7 @@ class MainController: UIViewController {
|
|||
|
||||
let clickAction = TableRowAction<ConfigurableTableViewCell>(.click) { [weak self] (data) in
|
||||
|
||||
switch (data.indexPath as NSIndexPath).row {
|
||||
switch data.indexPath.row {
|
||||
case 0:
|
||||
self?.performSegue(withIdentifier: "autolayoutcells", sender: nil)
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public enum TableRowActionType {
|
|||
|
||||
public protocol RowAction {
|
||||
|
||||
var id: String? { get set }
|
||||
var type: TableRowActionType { get }
|
||||
|
||||
func invokeActionOn(cell: UITableViewCell?, item: Any, path: IndexPath) -> Any?
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ private enum TableRowActionHandler<CellType: ConfigurableCell> where CellType: U
|
|||
|
||||
open class TableRowAction<CellType: ConfigurableCell>: RowAction where CellType: UITableViewCell {
|
||||
|
||||
open var id: String?
|
||||
open let type: TableRowActionType
|
||||
private let handler: TableRowActionHandler<CellType>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue