I have been searching and trying to get my UITableView
section header to allow multi line text but I cannot get it to work. This is what it's displaying as:
But the text is: What colour are the home shirts of Everton Football Club?
What I'm currently trying is:
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let label = UILabel()
label.lineBreakMode = .byWordWrapping
label.numberOfLines = 0
label.text = question?.question
return label
}
And place the following in the viewDidLoad
event
tableView.estimatedRowHeight = 44.0
tableView.rowHeight = UITableViewAutomaticDimension
But it hasn't made any difference. Can anyone help me out?