ShowDirectoryViewController: Fix section header height for search input section. Handle auto layout for DirectoryNetworkTableHeaderFooterView.

This commit is contained in:
SBiOSoftWhare
2021-06-15 15:34:29 +02:00
parent 57b1928b9f
commit eac3a27d63
2 changed files with 34 additions and 14 deletions
@@ -22,6 +22,10 @@ final class ShowDirectoryViewController: UIViewController {
// MARK: - Constants
private enum Constants {
static let networkHeaderViewEstimatedHeight: CGFloat = 40.0
}
// MARK: - Properties
// MARK: Outlets
@@ -312,9 +316,24 @@ extension ShowDirectoryViewController: UITableViewDelegate {
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 40
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView,
estimatedHeightForHeaderInSection section: Int) -> CGFloat {
let directorySection = self.sections[section]
let estimatedHeight: CGFloat
switch directorySection {
case .searchInput:
estimatedHeight = 0.0
case .publicRoomsDirectory:
estimatedHeight = Constants.networkHeaderViewEstimatedHeight
}
return estimatedHeight
}
}
// MARK: - UISearchBarDelegate