marty-suzuki / ReverseExtension

A UITableView extension that enables cell insertion from the bottom of a table view.
MIT License
1.68k stars 130 forks source link

Custom section header view not working. #36

Open DavidTomic opened 6 years ago

DavidTomic commented 6 years ago

Hi,

If I use method for custom section header view than header is not presented properly:

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?

Can you provide me instructions what should I do to make this work, thank you.

ridvank commented 6 years ago

Any solution on this issue?

dufflink commented 6 years ago

Hi! You can use 'viewForFooterInSection' method in UITableViewDelegate and added UILabel().

func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let label = UILabel() label.text = messages.sectionInfoAtIndex(section).name label.textColor = UIColor.white.withAlphaComponent(0.4) label.center = tableView.center label.font = UIFont.boldSystemFont(ofSize: 10) label.textAlignment = .center return label }

It's work for me

toshi0383 commented 3 years ago

@dufflink It works except for the section index NOT reversed, right? fyi: https://github.com/marty-suzuki/ReverseExtension/pull/58 😉