Skip to content

Instantly share code, notes, and snippets.

@anirudhamahale
Created March 22, 2018 10:55
Show Gist options
  • Save anirudhamahale/043ec38d9351cb53ccdfc8d9f06a366e to your computer and use it in GitHub Desktop.
Save anirudhamahale/043ec38d9351cb53ccdfc8d9f06a366e to your computer and use it in GitHub Desktop.
This contains the useful extensions for the UINavigationBar
extension UINavigationBar {
func hideShadowImage() {
self.shadowImage = UIImage()
if self.barStyle != .black {
self.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
}
}
}
// Here is the usage.
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.hideShadowImage()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment