title: UISearchController not shown if not set in viewDidLoad method
body: <p>I have a view controller that presents different child views. Each child view is created by view controller calling <code>UINib()</code> method and the view controller passes itself as a parameter to that view.</p>
  
  <pre><code>class func instanceFromNib(parentViewController: UIViewController) -&gt; UIView {
      let view = UINib(nibName: "PodcastsPage", bundle: nil).instantiate(withOwner: nil, options: nil)[0] as! PodcastsPage
      view.viewController = parentViewController
      return view as UIView
  }
  </code></pre>
  
  <p>As soon as the view receives a reference to its parent view controller it setups appropriate navigation bar</p>
  
  <pre><code>private var viewController: UIViewController! {
      didSet {
          setupNavigationBar()
      }
  }
  </code></pre>
  
  <p>Inside the <code>setupNavigationBar()</code> I have code that should add <code>UISearchController</code> into the view controller's navigation bar</p>
  
  <pre><code>func setupNavigationBar() {
      guard let navigationBar = viewController.navigationController?.navigationBar else {
          return
      }
  
      navigationBar.isTranslucent = false
      navigationBar.barTintColor = .navigationBar
      navigationBar.titleTextAttributes = [
          .font: UIFont(name: "AvenirNext-DemiBold", size: 18.0)!,
          .foregroundColor: UIColor.textPrimary
      ]
  
      viewController.navigationItem.title = "Follow Podcasts"
  
      let nextButton = UIBarButtonItem(title: "Finish", style: .done, target: nil, action: nil)
      nextButton.tintColor = .orangePrimary
      viewController.navigationItem.setRightBarButton(nextButton, animated: false)
  
      // Set UISearchController here //
      let searchController = UISearchController(searchResultsController: nil)
      searchController.searchBar.placeholder = "Search"
      searchController.searchResultsUpdater = self
      viewController.navigationItem.searchController = searchController
      viewController.navigationItem.hidesSearchBarWhenScrolling = false
  }
  </code></pre>
  
  <p>The <code>UISearchController</code> isn't visible when I run the app though
  <a href="https://i.stack.imgur.com/8UNcf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8UNcf.jpg" alt="not visible UISearchController"></a></p>
  
  <p>However, if I set the <code>UISearchController</code> inside the view controller's <code>viewDidLoad</code> like so, the search bar is actually present.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      let searchController = UISearchController(searchResultsController: nil)
      searchController.searchBar.placeholder = "Search"
      navigationItem.searchController = searchController
      navigationItem.hidesSearchBarWhenScrolling = false
  }
  </code></pre>
  
  <p>What do I have to do to set up <code>UISearchController</code> from the child view?</p>