I am writing this in viewDidLoad()
for the same
self.navigationController?.navigationBar.shadowImage = UIImage()
However this doesn't work on iOS versions < 11 What should I do in an order to remove shadow image irrespective of iOS version.
I am writing this in viewDidLoad()
for the same
self.navigationController?.navigationBar.shadowImage = UIImage()
However this doesn't work on iOS versions < 11 What should I do in an order to remove shadow image irrespective of iOS version.
Try the following code:
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
self.navigationController?.navigationBar.shadowImage = UIImage()
In your viewDiDLoad()
add this:
self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")
For me worked