1

UINavigationBar.apperance().titleTextAttributes not working. Swift Code is below.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    UINavigationBar.appearance().translucent = false
    UINavigationBar.appearance().barTintColor = UIColor.greenColor()
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName:UIColor.whiteColor()]

    return true
}

Any idea?

SARANGA
  • 172
  • 1
  • 8

1 Answers1

0

Add below code in Appdelegate didFinishLaunchingWithOptions method

 let navFont = UIFont(name: "HelveticaNeue-Bold", size: 30.0)
 UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.blackColor(), NSAttributedStringKey.font: navFont!]
Darshan
  • 2,272
  • 3
  • 31
  • 43