[iOS] sometimes on iOS10 downloaded categories not displayed, fixed

This commit is contained in:
Aleksey Belouosv 2018-07-12 12:41:48 +03:00 committed by Vlad Mihaylenko
parent b2a37ece23
commit d414978221

View file

@ -30,13 +30,13 @@ class DownloadedBookmarksViewController: MWMViewController {
tableView.tableFooterView = bottomView
tableView.registerNib(cell: CatalogCategoryCell.self)
tableView.registerNibForHeaderFooterView(BMCCategoriesHeader.self)
if #available(iOS 11, *) { return } // workaround for https://jira.mail.ru/browse/MAPSME-8101
reloadData()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
dataSource.reloadData()
noDataView.isHidden = dataSource.categoriesCount > 0
tableView.reloadData()
reloadData()
}
override func viewDidLayoutSubviews() {
@ -61,6 +61,12 @@ class DownloadedBookmarksViewController: MWMViewController {
animated: true)
}
private func reloadData() {
dataSource.reloadData()
noDataView.isHidden = dataSource.categoriesCount > 0
tableView.reloadData()
}
private func setCategoryVisible(_ visible: Bool, at index: Int) {
dataSource.setCategory(visible: visible, at: index)
let categoriesHeader = tableView.headerView(forSection: 0) as! BMCCategoriesHeader