add init to builder
This commit is contained in:
parent
533c6e6eb8
commit
42eec9243e
|
|
@ -24,16 +24,20 @@ public protocol RowBuilder {
|
|||
}
|
||||
|
||||
public class TableRowBuilder<ItemType, CellType: ConfigurableCell where CellType.T == ItemType, CellType: UITableViewCell>: RowBuilder {
|
||||
|
||||
public typealias BuilderHandler = (TableRowBuilder) -> ()
|
||||
|
||||
|
||||
public var items: [ItemType]?
|
||||
public var actions: [TableRowAction<ItemType, CellType>]?
|
||||
|
||||
public init(handler: BuilderHandler) {
|
||||
public init(handler: (TableRowBuilder) -> ()) {
|
||||
handler(self)
|
||||
}
|
||||
|
||||
public init(items: [ItemType], actions: [TableRowAction<ItemType, CellType>]? = nil) {
|
||||
|
||||
self.items = items
|
||||
self.actions = actions
|
||||
}
|
||||
|
||||
// MARK: - RowBuilder -
|
||||
|
||||
public func rowItems() -> [Row]? {
|
||||
|
|
|
|||
Loading…
Reference in New Issue