UINavigationBar.appearance().shadowImage = UIImage() in swift 4

1.5k views Asked by At

How can I implement this code in swift 4 or xcode 9?

// Remove hairline between navigation bar and anything below such as search bar
UINavigationBar.appearance().shadowImage = UIImage()

I want to remove navBar underline.

2

There are 2 answers

0
Vini App On BEST ANSWER

Please check :

self.navigationController?.navigationBar.shadowImage = UIImage()
0
Rajeev Udayan On

Don't worry copy pasting will work.

// Remove Bottom Shadow
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)