From d5d785218ac75a71c5a5fdd5f30aba6f9c722e4f Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Fri, 21 Oct 2016 01:35:27 +0300 Subject: [PATCH] improve custom action init --- Sources/TableRowAction.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/TableRowAction.swift b/Sources/TableRowAction.swift index ad92bb4..40760cb 100644 --- a/Sources/TableRowAction.swift +++ b/Sources/TableRowAction.swift @@ -65,6 +65,12 @@ open class TableRowAction where CellType: UITableVie self.handler = .voidAction(handler) } + public init(_ key: String, handler: @escaping (_ options: TableRowActionOptions) -> Void) { + + self.type = .custom(key) + self.handler = .voidAction(handler) + } + public init(_ type: TableRowActionType, handler: @escaping (_ options: TableRowActionOptions) -> T) { self.type = type