improve custom action init

This commit is contained in:
Max Sokolov 2016-10-21 01:35:27 +03:00
parent 443b8aaa62
commit d5d785218a
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ open class TableRowAction<CellType: ConfigurableCell> where CellType: UITableVie
self.handler = .voidAction(handler)
}
public init(_ key: String, handler: @escaping (_ options: TableRowActionOptions<CellType>) -> Void) {
self.type = .custom(key)
self.handler = .voidAction(handler)
}
public init<T>(_ type: TableRowActionType, handler: @escaping (_ options: TableRowActionOptions<CellType>) -> T) {
self.type = type