From 981a3c57d85ad749b20f84928c4ebd23367d1658 Mon Sep 17 00:00:00 2001 From: Simon Jarbrant Date: Sun, 8 Sep 2019 16:59:12 +0200 Subject: [PATCH] Add support for specifying section header and footer titles through TableViewDiffableDataSource subclasses --- .../UIKit/TableViewDiffableDataSource.swift | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Sources/UIKit/TableViewDiffableDataSource.swift b/Sources/UIKit/TableViewDiffableDataSource.swift index 12c4c17..67ce2d7 100644 --- a/Sources/UIKit/TableViewDiffableDataSource.swift +++ b/Sources/UIKit/TableViewDiffableDataSource.swift @@ -94,6 +94,28 @@ open class TableViewDiffableDataSource String? { + return nil + } + + /// Returns the title for the specified section's footer. + /// + /// - Parameters: + /// - tableView: A table view instance managed by `self`. + /// - section: An index of section. + /// + /// - Returns: The title for the specified section's footer, or `nil` for no title. + open func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { + return nil + } + /// Returns a cell for row at specified index path. /// /// - Parameters: