diff --git a/Sources/Jenga/Core/Row/BasicRow.swift b/Sources/Jenga/Core/Row/BasicRow.swift index 3dc0dfa..4140d01 100644 --- a/Sources/Jenga/Core/Row/BasicRow.swift +++ b/Sources/Jenga/Core/Row/BasicRow.swift @@ -82,6 +82,10 @@ open class BasicRow: SystemRow, RowConfigurable { public extension BasicRow { + func selectionStyle(_ value: UITableViewCell.SelectionStyle) -> Self { + reform { $0.selectionStyle = value } + } + func customize(_ value: @escaping ((T) -> Void)) -> Self { reform { $0.customize = value } } diff --git a/Sources/Jenga/Core/Row/TableRow.swift b/Sources/Jenga/Core/Row/TableRow.swift index 4f77bc5..96a4391 100644 --- a/Sources/Jenga/Core/Row/TableRow.swift +++ b/Sources/Jenga/Core/Row/TableRow.swift @@ -55,6 +55,10 @@ public extension TableRow { reform { $0.isSelectable = value } } + func selectionStyle(_ value: UITableViewCell.SelectionStyle) -> Self { + reform { $0.selectionStyle = value } + } + func data(_ data: Cell.CellData) -> Self { reform { $0.item = .constant(data) } } diff --git a/Sources/Jenga/Core/TableDirector.swift b/Sources/Jenga/Core/TableDirector.swift index 1271015..b00cb8e 100644 --- a/Sources/Jenga/Core/TableDirector.swift +++ b/Sources/Jenga/Core/TableDirector.swift @@ -158,8 +158,8 @@ extension TableDirector: UITableViewDataSource { let cell = tableView.dequeueReusableCell(withIdentifier: row.reuseIdentifier) ?? row.cellType.init(style: row.cellStyle, reuseIdentifier: row.reuseIdentifier) - (row as? RowConfigurable)?.configure(cell) cell.selectionStyle = row.selectionStyle + (row as? RowConfigurable)?.configure(cell) return cell } else { @@ -167,8 +167,8 @@ extension TableDirector: UITableViewDataSource { let cell = tableView.dequeueReusableCell(withIdentifier: row.reuseIdentifier, for: indexPath) - (row as? RowConfigurable)?.configure(cell) cell.selectionStyle = row.selectionStyle + (row as? RowConfigurable)?.configure(cell) return cell } }