From f8b417469bc04cf1189b2789c3fa796de9d88bac Mon Sep 17 00:00:00 2001 From: nixzhu Date: Wed, 29 Apr 2015 15:37:35 +0800 Subject: [PATCH] use navigationBarTitleFont --- Yep/AppDelegate.swift | 2 +- Yep/Extensions/UIFont+Yep.swift | 4 ++++ Yep/ViewControllers/Profile/ProfileViewController.swift | 2 +- Yep/ViewControllers/Settings/SettingsViewController.swift | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Yep/AppDelegate.swift b/Yep/AppDelegate.swift index e5106321..1978618e 100644 --- a/Yep/AppDelegate.swift +++ b/Yep/AppDelegate.swift @@ -209,7 +209,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let textAttributes = [ NSForegroundColorAttributeName: UIColor.yepTintColor(), NSShadowAttributeName: shadow, - NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)! + NSFontAttributeName: UIFont.navigationBarTitleFont() ] UINavigationBar.appearance().titleTextAttributes = textAttributes diff --git a/Yep/Extensions/UIFont+Yep.swift b/Yep/Extensions/UIFont+Yep.swift index cf17edba..b74dc262 100644 --- a/Yep/Extensions/UIFont+Yep.swift +++ b/Yep/Extensions/UIFont+Yep.swift @@ -20,4 +20,8 @@ extension UIFont { class func skillTextLargeFont() -> UIFont { return UIFont(name: "Helvetica-Light", size: 20)! } + + class func navigationBarTitleFont() -> UIFont { + return UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)! + } } diff --git a/Yep/ViewControllers/Profile/ProfileViewController.swift b/Yep/ViewControllers/Profile/ProfileViewController.swift index 183e1bc5..a11421d2 100644 --- a/Yep/ViewControllers/Profile/ProfileViewController.swift +++ b/Yep/ViewControllers/Profile/ProfileViewController.swift @@ -90,7 +90,7 @@ class ProfileViewController: UIViewController { let textAttributes = [ NSForegroundColorAttributeName: UIColor.whiteColor(), - NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)! + NSFontAttributeName: UIFont.navigationBarTitleFont() ] navigationController.navigationBar.titleTextAttributes = textAttributes diff --git a/Yep/ViewControllers/Settings/SettingsViewController.swift b/Yep/ViewControllers/Settings/SettingsViewController.swift index dd46d681..8712e796 100644 --- a/Yep/ViewControllers/Settings/SettingsViewController.swift +++ b/Yep/ViewControllers/Settings/SettingsViewController.swift @@ -47,7 +47,7 @@ class SettingsViewController: UIViewController { let textAttributes = [ NSForegroundColorAttributeName: UIColor.yepTintColor(), - NSFontAttributeName: UIFont(name: "HelveticaNeue-CondensedBlack", size: 20)! + NSFontAttributeName: UIFont.navigationBarTitleFont() ] navigationController.navigationBar.titleTextAttributes = textAttributes