title: Attempting to load the view of a view controller while it is deallocating... UISearchController
body: <p>I have code that creates a <code>UISearchController' in my UIVIew's</code>viewDidLoad`.</p>
  
  <pre><code> self.resultSearchController = ({
          let controller = UISearchController(searchResultsController: nil)
          controller.searchResultsUpdater = self
          controller.searchBar.delegate = self
          controller.dimsBackgroundDuringPresentation = false
          controller.searchBar.sizeToFit()
          controller.hidesNavigationBarDuringPresentation = false //prevent search bar from moving
          controller.searchBar.placeholder = "Search for song"
  
          self.myTableView.tableHeaderView = controller.searchBar
  
          return controller
  
      })()
  </code></pre>
  
  <p>Right after this closure finishes, this warning appears in the console:</p>
  
  <pre><code>Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (&lt;UISearchController: 0x154d39700&gt;)
  </code></pre>
  
  <p>I don't get what I am doing wrong. <a href="https://stackoverflow.com/questions/31830302/why-attempting-to-load-while-deallocating-uisearchcontroller">This similar question</a> is not really my situation (At least I don't think so). What is going on?</p>