swift 4
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = UIColor.white
let nav = UINavigationController(rootViewController: HomeVC())
//設置導航欄背景顏色
nav.navigationBar.barTintColor = UIColor.blue
let dict:NSDictionary = [NSAttributedStringKey.foregroundColor: UIColor.white,NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 18)]
//標題顏色
nav.navigationBar.titleTextAttributes = dict as? [NSAttributedStringKey : AnyObject]
//item顏色
nav.navigationBar.tintColor = UIColor.gray
window?.rootViewController = nav
window?.makeKeyAndVisible()
return true
}