Revised header logic to play along with the rest.

This commit is contained in:
Kevin G Christiano 2019-08-15 09:57:58 -04:00
parent 03fceaab5a
commit 6bff2e844d

View File

@ -105,8 +105,10 @@ class MasterViewController: UIViewController, UITableViewDelegate, UITableViewDa
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard section == 0 else { return nil }
let button = UIButton(frame: .zero)
button.setTitle("RequestView", for: .normal)
button.setTitle((((sectionsMap as NSDictionary).allKeys[section]) as! String), for: .normal)
button.backgroundColor = .red
button.tag = section // why not... ``\__(~_~)__/``
button.addTarget(self, action: #selector(requestJSON), for: .touchUpInside)