Remove empty section spaces

This commit is contained in:
ismailgulek
2021-01-22 20:09:21 +03:00
parent ee9fee0b49
commit f10b18b6c1
@@ -36,6 +36,8 @@ final class CallTransferSelectContactViewController: UIViewController {
private enum Constants {
static let maxNumberOfRecentContacts: UInt = 10
static let sectionHeaderHeightDefault: CGFloat = 30.0
static let sectionHeaderHeightHidden: CGFloat = 0.01
}
private var session: MXSession!
@@ -237,6 +239,20 @@ extension CallTransferSelectContactViewController: UITableViewDelegate {
return sections[section].header
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if sections[section].header != nil {
return Constants.sectionHeaderHeightDefault
}
return Constants.sectionHeaderHeightHidden
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if sections[section].header != nil {
return Constants.sectionHeaderHeightDefault
}
return Constants.sectionHeaderHeightHidden
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)