Use a constant for section & footer height

This commit is contained in:
ismailgulek 2020-09-23 11:45:10 +03:00
parent 5c18b46e68
commit ba6c9be372

View file

@ -24,6 +24,7 @@ final class RoomInfoListViewController: UIViewController {
private enum Constants {
static let defaultStyleCellReuseIdentifier = "default"
static let tableViewSectionMinHeight: CGFloat = 8.0
}
// MARK: - Properties
@ -370,14 +371,14 @@ extension RoomInfoListViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if sections[section].header == nil {
return 8
return Constants.tableViewSectionMinHeight
}
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
if sections[section].footer == nil {
return 8
return Constants.tableViewSectionMinHeight
}
return UITableView.automaticDimension
}