title: setting titleView of custom UINavigationBar
body: <p>I have a custom navigation bar that doesn't really do any navigation controlling (app only has one view) its instead used as a header to display the logo against a solid background colour. So I put a navigation bar onto the main view controller and created an outlet so I can reference it in the code. (Using swift by the way).</p>
  
  <p>Right now I'm struggling with setting the logo image in the center of the nav bar. I need to do this with the titleView (instead of setting an entire background image). So far what I've read says to use <code>self.navigationItem.titleView</code> in the view controller, but I think that only works when using a UINavigationController. Here is my code so far:</p>
  
  <pre><code>@IBOutlet weak var navBar: UINavigationBar!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      let logoImage = UIImageView(frame: CGRect(x:0, y:0, width: 200, height: 45))
      logoImage.contentMode = .ScaleAspectFit
  
      let logo = UIImage(named: "logo.png")
      logoImage.image = logo
      self.navigationItem.titleView = logoImage
  }
  </code></pre>
  
  <p>But this doesn't work. How do I get access to the titleView using a custom UINavigationBar like this?</p>