Skip to content

Commit

Permalink
Style navigation bar directly, not via UIAppearance globals
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrubin committed Feb 1, 2016
1 parent 26f62ff commit e71e20b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Authenticator/Source/OTPAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ class OTPAppDelegate: UIResponder, UIApplicationDelegate {
let app = AppController()

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
UINavigationBar.appearance().barTintColor = UIColor.otpBarBackgroundColor
UINavigationBar.appearance().tintColor = UIColor.otpBarForegroundColor
UINavigationBar.appearance().titleTextAttributes = [
NSForegroundColorAttributeName: UIColor.otpBarForegroundColor,
NSFontAttributeName: UIFont(name: "HelveticaNeue-Light", size: 20)!
]

UIToolbar.appearance().barTintColor = UIColor.otpBarBackgroundColor
UIToolbar.appearance().tintColor = UIColor.otpBarForegroundColor

Expand Down
11 changes: 11 additions & 0 deletions Authenticator/Source/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
import UIKit

class OpaqueNavigationController: UINavigationController {
override func viewDidLoad() {
super.viewDidLoad()

navigationBar.barTintColor = UIColor.otpBarBackgroundColor
navigationBar.tintColor = UIColor.otpBarForegroundColor
navigationBar.titleTextAttributes = [
NSForegroundColorAttributeName: UIColor.otpBarForegroundColor,
NSFontAttributeName: UIFont(name: "HelveticaNeue-Light", size: 20)!
]
}

override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationBar.translucent = false
Expand Down

0 comments on commit e71e20b

Please sign in to comment.