title: Change the style of the UISearchController views?
body: <h2>Question:</h2>
  
  <p>How do I change the color/theme/style of the <code>UISearchController</code> in <code>tvOS</code>?</p>
  
  <p>( Would appear I need to set <a href="https://developer.apple.com/reference/uikit/uistatusbarstyle" rel="nofollow noreferrer">UIStatusBarStyle</a> some way, since the <a href="https://stackoverflow.com/questions/38862208/preferredstatusbarstyle-removed-in-swift-3">preferredStatusBarStyle</a> override does not exist in <code>tvOS</code> for <code>UISearchController</code>)</p>
  
  <h2>Description:</h2>
  
  <p>Method called in my <code>AppDelegate</code> to programmatically create a <code>searchNavigationController</code> with on top a <code>UISearchController</code> and on bottom my custom <code>UITableViewController</code> called "<code>searchResultsController</code>" (<code>SearchViewController</code>)</p>
  
  <pre><code>func configueSearchController() -&gt; UIViewController {
  
      let storyboard = UIStoryboard(name: "Search", bundle: nil)
      guard let searchResultsController = storyboard.instantiateViewController(withIdentifier: SearchViewController.storyboardIdentifier) as? SearchViewController else {
          fatalError("Unable to instatiate a SearchResultViewController from the storyboard.")
      }
  
      /*
       Create a UISearchController, passing the `searchResultsController` to
       use to display search results.
       */
  
      let searchController = UISearchController(searchResultsController: searchResultsController)
      searchController.searchResultsUpdater = searchResultsController
      searchController.searchBar.placeholder = NSLocalizedString("Enter keyword (e.g. Gastric Bypass)", comment: "")
  
      // Contain the `UISearchController` in a `UISearchContainerViewController`.
      let searchContainer = UISearchContainerViewController(searchController: searchController)
      searchContainer.title = NSLocalizedString("Search", comment: "")
  
      // Finally contain the `UISearchContainerViewController` in a `UINavigationController`.
      let searchNavigationController = UINavigationController(rootViewController: searchContainer)
      return searchNavigationController
  
  }
  </code></pre>
  
  <p><strong>Image of the visual representation of the above method:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ODv5v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ODv5v.png" alt="UISearchViewController"></a></p>
  
  <h2>What I've tried:</h2>
  
  <p>I've attempted to change the style via different approaches and none of them gave the desired outcome.</p>
  
  <p>This has no effect on the searchBar:</p>
  
  <pre><code>searchController.searchBar.searchBarStyle = .minimal //or .prominent or .default
  </code></pre>
  
  <p>This only makes the searchBar (actual input area black.. with black text..):</p>
  
  <pre><code>searchController.searchBar.backgroundColor = .black
  </code></pre>
  
  <p>This only makes the whole background view of the UISearchController black. Everything is black and thus the keyboard can not be seen.</p>
  
  <pre><code>searchController.view.backgroundColor = .black
  </code></pre>
  
  <p>The ideal solution would be a theme change from the standard <code>.default</code> to something <code>.dark</code>. Because not only does the background color have to change but the borders and text colors must too.</p>
  
  <p><strong>Attempted to implement <a href="https://stackoverflow.com/questions/38862208/preferredstatusbarstyle-removed-in-swift-3">this solution</a>:</strong></p>
  
  <pre><code>//UISearchController
  override var preferredStatusBarStyle: UIStatusBarStyle {
      return .lightContent
  }
  </code></pre>
  
  <p>However, this override does not seem to exist for tvOS. Any reason why?</p>