I am using the code below to set the uitableview viewForHeaderInSection and then I am trying to update just one textfield in the section header but my reference is nil.
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = tableView.dequeueReusableHeaderFooterView(withIdentifier: "ReusableHeader")
header.timeField.text = String(describing: secondsToHoursMinutesSeconds(seconds: counter))
return header
}
My reference code where header comes back as nil:
let header = self.tableView.headerView(forSection: 0)
header?.setNeedsLayout()