Skip to content

Instantly share code, notes, and snippets.

@shawn-frank
Last active February 8, 2023 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawn-frank/aa895e01a462b17cbcc69b3c09783c42 to your computer and use it in GitHub Desktop.
Save shawn-frank/aa895e01a462b17cbcc69b3c09783c42 to your computer and use it in GitHub Desktop.
// REF: https://stackoverflow.com/a/62787968/1619193
private func configureNavBar() {
navigationBar.standardAppearance.backgroundColor = UIColor.clear
navigationBar.standardAppearance.backgroundEffect = nil
navigationBar.standardAppearance.shadowImage = UIImage()
navigationBar.standardAppearance.shadowColor = .clear
navigationBar.standardAppearance.backgroundImage = UIImage()
}
private func configureNavBar2() {
navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
navigationBar.prefersLargeTitles = true
UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .normal)
navigationBar.isTranslucent = true
configureBackButton()
}
// REF: https://stackoverflow.com/a/53968792/1619193
private func configureBackButton() {
UIBarButtonItem.appearance().tintColor = .meRegularBlue
UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.lightGray],
for: .normal)
}
private func configureNavBar3() {
navigationBar.prefersLargeTitles = true
navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black]
navigationBar.barTintColor = .white
UINavigationBar.appearance().backgroundColor = .white
navigationBar.isTranslucent = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment