diff --git a/Sources/TableDirector.swift b/Sources/TableDirector.swift index b306b8b..4ea3da6 100644 --- a/Sources/TableDirector.swift +++ b/Sources/TableDirector.swift @@ -254,8 +254,7 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate { return self } - @discardableResult - open func delete(index: Int) -> Self { + open func delete(sectionAt index: Int) -> Self { sections.remove(at: index) return self @@ -269,4 +268,14 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate { return self } + + // MARK: - deprecated methods - + + @available(*, deprecated, message: "Use 'delete(sectionAt:)' method instead") + @discardableResult + open func delete(index: Int) -> Self { + + sections.remove(at: index) + return self + } } diff --git a/Sources/TableSection.swift b/Sources/TableSection.swift index 127ee0e..273701e 100644 --- a/Sources/TableSection.swift +++ b/Sources/TableSection.swift @@ -88,6 +88,13 @@ open class TableSection { rows[index] = row } + open func delete(rowAt index: Int) { + rows.remove(at: index) + } + + // MARK: - deprecated methods - + + @available(*, deprecated, message: "Use 'delete(rowAt:)' method instead") open func delete(index: Int) { rows.remove(at: index) }