title: Navigation controller title not showing up?
body: <p>So when I have my <code>OptionsViewController</code> as the <code>rootViewController</code> in the <code>AppDelegate didFinishLaunchingWithOptions</code>...</p>
  <pre><code>let rootVC = OptionsViewController()
          let navigationController = UINavigationController(rootViewController: rootVC)
          navigationController.navigationBar.barTintColor = .white
          navigationController.navigationBar.isTranslucent = false
          navigationController.navigationBar.tintColor = .black
          self.window = UIWindow(frame: UIScreen.main.bounds)
          self.window!.rootViewController = navigationController
          self.window?.makeKeyAndVisible()
  </code></pre>
  <p>...setting the title of the <code>OptionViewController</code> works if I do this in <code>viewDidLoad()</code>:</p>
  <pre><code>    title = &quot;Route Options&quot;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/uCH8u.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uCH8u.png" alt="enter image description here" /></a></p>
  <p>But when I push <code>OptionsViewController</code> onto the navigation stack the title doesn't show up.</p>
  <p>I.e. if I start w/ a different view as the <code>rootViewController</code> in <code>AppDelegate</code>:</p>
  <pre><code> let rootVC = HomeViewController()
      let navigationController = UINavigationController(rootViewController: rootVC)
      navigationController.navigationBar.barTintColor = .white
      navigationController.navigationBar.isTranslucent = false
      navigationController.navigationBar.tintColor = .black
      self.window = UIWindow(frame: UIScreen.main.bounds)
      self.window!.rootViewController = navigationController
      self.window?.makeKeyAndVisible()
  </code></pre>
  <p>And in <code>HomeViewController</code> I push my <code>OptionViewController</code> like this:</p>
  <pre><code>    let optionsVC = OptionsViewController()
      navigationController?.pushViewController(optionsVC, animated: true)
  </code></pre>
  <p>The title does not show up!</p>
  <p><a href="https://i.stack.imgur.com/lUqA7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lUqA7.png" alt="enter image description here" /></a></p>
  <p>The only way I've managed for the title to show up is by doing (in <code>OptionViewController</code>)</p>
  <pre><code>navigationController?.navigationBar.topItem?.title = &quot;Route Options&quot;
  </code></pre>
  <p>But it shows up as the back button rather than in the middle, which is not what I want.</p>
  <p><a href="https://i.stack.imgur.com/8KUbP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8KUbP.png" alt="enter image description here" /></a></p>
  <p>If anyone could tell me how I could set the title so that it is on the middle of the navigation bar when it is pushed onto the navigationController stack that would be great!</p>
  <h1>Code</h1>
  <p><strong>AppDelegate.swift</strong></p>
  <pre><code>class AppDelegate: UIResponder, UIApplicationDelegate {
       func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
          let rootVC = HomeViewController()
          let navigationController = UINavigationController(rootViewController: rootVC)
          let barAppearance = UINavigationBar.appearance()
          barAppearance.barTintColor = UIColor.blue
          barAppearance.tintColor = UIColor.white
          barAppearance.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
          self.window = UIWindow(frame: UIScreen.main.bounds)
          self.window!.rootViewController = navigationController
          self.window?.makeKeyAndVisible()
  
          return true
      }
  </code></pre>
  <p><strong>HomeViewController.swift</strong></p>
  <pre><code>class HomeViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, DestinationDelegate {
      func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
              let optionsVC = OptionsViewController()
              self.definesPresentationContext = false //else going to try and present optionVC on homeVC when in optionVC
              navigationController?.pushViewController(optionsVC, animated: true)
          }
          tableView.deselectRow(at: indexPath, animated: true)
      }
  }
  </code></pre>
  <p><strong>OptionsViewController.swift</strong></p>
  <pre><code>class OptionsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource,
      DestinationDelegate, SearchBarCancelDelegate,UISearchBarDelegate,
      CLLocationManagerDelegate {
      override func viewDidLoad() {
          self.title = &quot;Route Options&quot;
      }
  </code></pre>