xai3 / Shoyu

Easier way to represent the structure of UITableView.
MIT License
278 stars 24 forks source link

Configure header or footer height. #42

Open bannzai opened 7 years ago

bannzai commented 7 years ago

Why

It seems that behavior has changed when UITableView#heightForHeaderInSection behavior return 0 and return tableView.sectionHeaderHeight(-1) when it becomes iOS 11. Also delegate for footer has same problem.

Problem

When Using grouped style UITableView

When Using plain style UITableView

I faced when using grouped UITableView and not instanciate SectionHeaderFooterType.height(or heightFor(_:section:)). So, using Shoyu return 0 height via UITableView#heightForHeaderInSection delegate method in this case.

But I confirmed iOS 10.3 simulator and iOS 11 simulator get difference height for header at this time.

How to resolve

I guess necessary switch for UITableView.style about returning height for delegate method. Grouped UITableView returning always tableView.sectionHeaderHeight when not configure SectionHeaderFooterType.height(or heightFor(_:section:)). Plain UITableViewreturning always0when not configureSectionHeaderFooterType.height(or heightFor(_:section:)).

I guess it is necessary switch of UITableView.style about returning height for delegate method Grouped style UITableView return tableView.sectionHeaderHeight when not configure SectionHeaderFooterType.height(or heightFor(_:section:)). Plain style UITableView return always 0 when not configure SectionHeaderFooterType.height(or heightFor(_:section:)).

Plaase check this issue problem. Thank you.

xai3 commented 7 years ago

@bannzai Hi! Thank you for reporting. I agree with your solution. Please to pull request. Thanks!