Skip to content

Instantly share code, notes, and snippets.

@novinfard
Last active February 13, 2019 09:41
Show Gist options
  • Save novinfard/178dd6cabdf4809db84dec5262284591 to your computer and use it in GitHub Desktop.
Save novinfard/178dd6cabdf4809db84dec5262284591 to your computer and use it in GitHub Desktop.
[Setup navigation bar's color and font]
guard let navBar = self.navigationController else { return }
if #available(iOS 11.0, *) {
navBar.navigationBar.prefersLargeTitles = true
navBar.navigationItem.largeTitleDisplayMode = .always
navBar.navigationBar.largeTitleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 36)]
}
navBar.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor: UIColor.white,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 16)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment