title: How to use an image logo on the navigation bar instead of title
body: <p>I have tried a couple different codes but couldn't make the logo show</p>
  
  <pre><code>import UIKit 
  class HomeViewController: UIViewController { 
  
  override func viewDidLoad() { 
  super.viewDidLoad() 
  
  let logo = UIImage(named: "logo.png") 
  let imageView = UIImageView(image: logo) 
  self.navigationItem.titleView = imageView
  navigationItem.titleView?.sizeToFit() 
   } 
  }
  </code></pre>
  
  <p>I even tried to include IB in the class itself didn't work either, it doesn't seem to work that way</p>
  
  <pre><code>@IBOutlet weak var navBar: UINavigationItem!
  </code></pre>
  
  <p>PS. My logo is a 200x40px png and its named logo.png in the assets.</p>
  
  <p>My storyboard</p>
  
  <p><a href="http://i68.tinypic.com/b68t8o.png" rel="noreferrer">http://i68.tinypic.com/b68t8o.png</a></p>
  
  <p>Any help is appreciated</p>
  
  <p>Edit: I solved my problem by putting an image view there instead of this whole navigation item story. Thanks for your suggestions though.</p>