title: Search Controller in Navigation Item confusing behaviour
body: <p>So i have a searchcontroller on my navigationItem.</p>
  
  <pre><code>// View controller
  var searchController = UISearchController(searchResultsController: nil)
  
  override func viewWillAppear(_ animated: Bool) {
      tableView.reloadData()
      if #available(iOS 11.0, *) {
          navigationController?.navigationBar.prefersLargeTitles = true
      }
      if employeeSearchList.count &gt; 10 {
          if #available(iOS 11.0, *) {
              navigationItem.searchController = searchController
          } else {
              tableView.tableHeaderView = searchController.searchBar
          }
      } else {
          if #available(iOS 11.0, *) {
              let search = UISearchController(searchResultsController: nil)
              navigationItem.searchController = search
              navigationItem.searchController = nil
          } else {
              tableView.tableHeaderView = nil
          }
      }
      UIView.animate(withDuration: 0.50, animations: {
          self.view.layoutIfNeeded()
      })
  }
  </code></pre>
  
  <p>This piece of code runs perfectly. If the count is less than 10, the search controller is set, otherwise it is set to an empty search controller and then set to <code>nil</code>, so that it disappears from the UI.</p>
  
  <pre><code>func viewDidLoad() {
      .
      .
      .
      searchController.searchResultsUpdater = self
      searchController.dimsBackgroundDuringPresentation = false
      searchController.searchBar.tintColor = tintColor
  
      // Table view editing delegate -&gt; delete operation
      if employeeSearchList.count &lt; 10 {
          if #available(iOS 11.0, *) {
              let search = UISearchController(searchResultsController: nil)
              navigationItem.searchController = search
              navigationItem.searchController = nil
          } else {
              tableView.tableHeaderView = nil
          }
          UIView.animate(withDuration: 0.50, animations: {
              tableView.reloadData()
              self.view.layoutIfNeeded()
          })
      }
      .
      .
      .
  }
  </code></pre>
  
  <p>Now my problem is, when i present a view controller above this one and then dismiss it, the <code>viewWillAppear</code> executes fine but the search controller doesn't show up. But if i push the view controller and come back, it shows up.</p>
  
  <p>What are the main difference between the 2 operations ? (push/pop &amp; present/dismiss)</p>