From 6bff2e844d774d7f9c0338e3cce71490a4f33d71 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 15 Aug 2019 09:57:58 -0400 Subject: [PATCH] Revised header logic to play along with the rest. --- JSONCreator_iOS/JSONCreator/MasterViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/JSONCreator_iOS/JSONCreator/MasterViewController.swift b/JSONCreator_iOS/JSONCreator/MasterViewController.swift index 110b2bd..2cfded2 100644 --- a/JSONCreator_iOS/JSONCreator/MasterViewController.swift +++ b/JSONCreator_iOS/JSONCreator/MasterViewController.swift @@ -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)