title: UISearchController iOS 11 Customization
body: <p>I had been using the following code prior to iOS 11 to customize the appearance of the <code>UISearchController</code> search bar:</p>
  
  <pre><code>var searchController = UISearchController(searchResultsController: nil)
  searchController.searchBar.setDefaultSearchBar()
  searchController.searchResultsUpdater = self
  
  if #available(iOS 11.0, *) {
      navigationItem.searchController = searchController
  } else {
      tableView.tableHeaderView = searchController.searchBar
  }
  
  extension UISearchBar {
      func setDefaultSearchBar() {
          self.tintColor = UIColor.blue
          self.searchBarStyle = .minimal
          self.backgroundImage = UIImage(color: UIColor.clear)
          let searchBarTextField = self.value(forKey: "searchField") as! UITextField
          searchBarTextField.textColor = UIColor.white
          searchBarTextField.tintColor = UIColor.blue
          searchBarTextField = .dark
      }
  }
  </code></pre>
  
  <p>However, the appearance of the search bar fails to update when running the same code on iOS 11.</p>
  
  <p><strong>iOS 10:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ZOj2F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZOj2F.png" alt="enter image description here"></a></p>
  
  <p><strong>iOS 11:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/GG7z0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GG7z0.png" alt="enter image description here"></a></p>
  
  <p>Much of the attention to this question so far has focused on the text color of the search bar. I am looking at more than this - the background color, tint color, the search indicator, clear button color, etc.</p>