title: How do I reload just the tableView section headers?
body: <p>So I'm trying to get the <code>UITableView</code> section headers to change in background and text color when switching from one segment to another on a segmented control. To so so I need to reload the tableView data but I only want to reload the section headers. When using</p>
  
  <pre><code>tableView.reloadData()
  </code></pre>
  
  <p>It works but it also resets the rest of the data in the tableView which I'm not trying to do.</p>
  
  <pre><code>override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -&gt; String? {
          let stringForThemeHeader = "Theme Settings"
          let stringForToggleHeader = "Password Settings"
          if section == 0 {
              return stringForThemeHeader
          } else {
              return stringForToggleHeader
          }
      }
  
  </code></pre>
  
  <p>That's the code for setting up the titles.</p>
  
  <pre><code>override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
          let header = view as! UITableViewHeaderFooterView
          if darkModeSegmentedControlSwitcher.selectedSegmentIndex == 1 || darkModeSegmentedControlSwitcher.selectedSegmentIndex == 2 {
              view.tintColor = UIColor.red
              header.textLabel?.textColor = UIColor.white
          } else {
              view.tintColor = UIColor.init(red: 247.0/255.0, green: 247.0/255.0, blue: 247.0/255.0, alpha: 1.0)
              header.textLabel?.textColor = UIColor.black
          }
  
      }
  </code></pre>
  
  <p>and that's the code to change the text and background. After a segment is selected it doesn't change unless the data of the entire tableView is reloaded using</p>
  
  <pre><code>tableView.reloadData()
  </code></pre>
  
  <p>So I just need to know how to reload only the section headers and my problem will be solved.</p>