# Palette navigation bar

> Source: <https://gist.github.com/Awalz/a42da7e3a273600a8461e64e929c906c>
> Published: 2017-09-16 19:07:00+00:00

gistfile1.txt

      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      
Learn more about bidirectional Unicode characters

 
    Show hidden characters

extension UINavigationBar {

    func setTheme() {

        barTintColor        = Palette.secondaryBackgroundColor

        tintColor           = Palette.accentColor

        titleTextAttributes = [NSAttributedStringKey.foregroundColor: Palette.accentColor, NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20.0)]

 

        if #available(iOS 11.0, *) {

            largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: Palette.accentColor]

            prefersLargeTitles = true

        }

    }

}
