From f19b63799967c999045f276348834f2a5c28642b Mon Sep 17 00:00:00 2001 From: Max Sokolov Date: Thu, 20 Oct 2016 12:13:30 +0300 Subject: [PATCH] deprecate some methods --- Sources/TableDirector.swift | 13 +++++++++++-- Sources/TableSection.swift | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) 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) }