Skip to content

Commit 1067d97

Browse files
committed
Hide BottomSheetListSelectorVC header if there is no title
1 parent 26afc18 commit 1067d97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

WooCommerce/Classes/ViewRelated/BottomSheet/ListSelector/BottomSheetListSelectorViewController.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ UIViewController, UITableViewDataSource, UITableViewDelegate where Command.Model
8181
}
8282

8383
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
84+
guard viewProperties.title != nil else {
85+
return nil
86+
}
8487
guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: BottomSheetListSelectorSectionHeaderView.reuseIdentifier)
8588
as? BottomSheetListSelectorSectionHeaderView else {
8689
fatalError()
@@ -103,7 +106,7 @@ private extension BottomSheetListSelectorViewController {
103106
tableView.dataSource = self
104107

105108
tableView.rowHeight = UITableView.automaticDimension
106-
tableView.estimatedSectionHeaderHeight = estimatedSectionHeight
109+
tableView.estimatedSectionHeaderHeight = viewProperties.title != nil ? estimatedSectionHeight : .zero
107110
tableView.sectionHeaderHeight = UITableView.automaticDimension
108111

109112
tableView.backgroundColor = .listForeground

0 commit comments

Comments
 (0)