Fix search section titles

This commit is contained in:
Shadowfacts 2019-12-16 22:23:12 -05:00
parent 05d79d5d03
commit 382decd7da
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 2 deletions

View File

@ -156,8 +156,12 @@ extension SearchTableViewController {
} }
class DataSource: UITableViewDiffableDataSource<Section, Item> { class DataSource: UITableViewDiffableDataSource<Section, Item> {
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { override func tableView(_ tableView: UITableView, titleForHeaderInSection sectionIndex: Int) -> String? {
return Section.allCases[section].displayName let currentSnapshot = snapshot()
for section in Section.allCases where currentSnapshot.indexOfSection(section) == sectionIndex {
return section.displayName
}
return nil
} }
} }
} }