title: How do I left align the title of a navigation bar in Xcode?
body: <p>I've been trying the following in order to get the title of a navigation bar left aligned:</p>
  
  <p>In the <code>AppDelegate.swift</code> file:</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
      // Override point for customization after application launch.
  
  
      UINavigationBar.appearance().barTintColor = UIColor.red
      UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:
          UIColor.white]
      return true
  }
  </code></pre>
  
  <p>In a <code>TableViewController.swift</code> file:</p>
  
  <pre><code>override func viewDidAppear(_ animated: Bool) {
          super.viewDidAppear(animated)
          self.navigationController?.navigationBar.topItem?.title = "Home"
      }
  </code></pre>
  
  <p>but nothing I find solves the problem.  I also tried the following that I found on here which does not show anything:</p>
  
  <p>in the <code>AppDelegate.swift</code> file:</p>
  
  <pre><code>func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
      // Override point for customization after application launch.
  
  
      UINavigationBar.appearance().barTintColor = UIColor.red
      UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:
          UIColor.white]
  let lbNavTitle = UILabel (frame: CGRect(x: 0, y: 40, width: 320, height: 40))
      lbNavTitle.center = CGPoint(x: 160, y: 285)
      lbNavTitle.textAlignment = .left
      lbNavTitle.text = "Home"
      self.navigationItem.titleView = lbNavTitle
  </code></pre>
  
  <p>In a <code>TableViewController.swift</code> file:</p>
  
  <pre><code>override func viewDidAppear(_ animated: Bool) {
      super.viewDidAppear(animated)
      self.navigationController?.navigationBar.topItem?.title = "Home"
      let lbNavTitle = UILabel (frame: CGRect(x: 0, y: 0, width: 320, height: 40))
      lbNavTitle.backgroundColor = UIColor.red
      lbNavTitle.textColor = UIColor.black
      lbNavTitle.numberOfLines = 0
      lbNavTitle.center = CGPoint(x: 0, y: 0)
      lbNavTitle.textAlignment = .left
      lbNavTitle.text = "Home"
  
      let string = NSMutableAttributedString ("Title/nSubTitle")
  
      self.navigationItem.titleView = lbNavTitle
  }
  </code></pre>