I have a UINavigation Controller which is used to push or pop Views. In the Initial view controller I want to hide the navigation Bar bottom 1 Pixel shadow. So I here's the code for that.
func setup(){
if #available(iOS 11.0, *) {
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationController?.navigationItem.largeTitleDisplayMode = .always
} else {
// Fallback on earlier versions
}
self.navigationBar.isTranslucent = true
self.navigationBar.clipsToBounds = true
self.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationBar.shadowImage = UIImage()
self.navigationBar.tintColor = UIColor(hexString: "#373839")
self.navigationBar.backgroundColor = UIColor.white
}
But when I push to second View controller the Navigation Bar's shadow is hidden even in this.
Does setting the Navigation Bar's properties in the Parent view controller effect those in all the controllers pushed from there on ? I thought Navigation Bar is specific to View controller a Navigation controller creates a new Navigation Bar for each pushed view.
Could someone help me understand this and how I could have 1 pixel shadow back on the Navigation Bar for only 1 view.