diff --git a/Sources/Classes/Views/SeparatorRowBox/SeparatorRowBox.swift b/Sources/Classes/Views/SeparatorRowBox/SeparatorRowBox.swift index cf8674f8..f87ca389 100644 --- a/Sources/Classes/Views/SeparatorRowBox/SeparatorRowBox.swift +++ b/Sources/Classes/Views/SeparatorRowBox/SeparatorRowBox.swift @@ -37,9 +37,7 @@ public final class SeparatorRowBox { /// - parameter row: TableRow which `cell` conforms to SeparatorCell public init(row: TableRow) where T: SeparatorCell { self.row = row - setSeparatorHandler = { separatorType in - row.set(separatorType: separatorType) - } + setSeparatorHandler = row.set } } diff --git a/Sources/Extensions/TableDirector/TableRow+AppearanceExtension.swift b/Sources/Extensions/TableDirector/TableRow+AppearanceExtension.swift index 5060f6fe..24ed16e1 100644 --- a/Sources/Extensions/TableDirector/TableRow+AppearanceExtension.swift +++ b/Sources/Extensions/TableDirector/TableRow+AppearanceExtension.swift @@ -26,7 +26,12 @@ fileprivate let updateAppearanceActionId = "TableRowUpdateAppearanceActionId" public extension TableRow where CellType: AppearanceProtocol { - @discardableResult func set(appearance: CellType.Appearance) -> Self { + func with(appearance: CellType.Appearance) -> Self { + set(appearance: appearance) + return self + } + + func set(appearance: CellType.Appearance) { removeAction(forActionId: updateAppearanceActionId) let action = TableRowAction(.configure) { options in @@ -35,8 +40,6 @@ public extension TableRow where CellType: AppearanceProtocol { action.id = updateAppearanceActionId on(action) - - return self } } diff --git a/Sources/Extensions/TableDirector/TableRow+SeparatorsExtensions.swift b/Sources/Extensions/TableDirector/TableRow+SeparatorsExtensions.swift index d69ad3cf..9076505c 100644 --- a/Sources/Extensions/TableDirector/TableRow+SeparatorsExtensions.swift +++ b/Sources/Extensions/TableDirector/TableRow+SeparatorsExtensions.swift @@ -22,11 +22,16 @@ import TableKit -private let configureSeparatorActionId = "TableRowConfigureSeparatorActionId" +fileprivate let configureSeparatorActionId = "TableRowConfigureSeparatorActionId" public extension TableRow where CellType: SeparatorCell { - @discardableResult func set(separatorType: CellSeparatorType) -> Self { + func with(separatorType: CellSeparatorType) -> Self { + set(separatorType: separatorType) + return self + } + + func set(separatorType: CellSeparatorType) { removeAction(forActionId: configureSeparatorActionId) let action = TableRowAction(.configure) { options in @@ -35,8 +40,6 @@ public extension TableRow where CellType: SeparatorCell { action.id = configureSeparatorActionId on(action) - - return self } }