title: Change font in navigation bar in Swift
body: <p>I'd like to change the font in the navigation bar. However the following code doesn't work, it causes the app to crash.</p>
  
  <pre><code>func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {
  
  UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: UIFont(name: "Lato-Light.ttf", size: 34)!]
  
       return true
  }
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <p>fatal error: <code>unexpectedly found nil while unwrapping an Optional value(lldb)</code> </p>
  
  <p>I have indeed added the font <strong>Lato-Light.ttf</strong> to my project so it should be able to find it.</p>