I am currently adding a shadow to my navigation bar using the following code:
self.navigationController?.navigationBar.layer.shadowColor = UIColor.black.cgColor
self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0.0, height: 4.0)
self.navigationController?.navigationBar.layer.shadowRadius = 4.0
self.navigationController?.navigationBar.layer.shadowOpacity = 0.3
self.navigationController?.navigationBar.layer.masksToBounds = false
This produces the following result:
The shadow is being shown correctly, however I do not want the 1px black border of the navigation bar to be shown, I only want the navigation bar to have a shadow. I know that setting the shadow property of the navigation bar to an empty image removes the border, but that also hides the shadow. Is there any way to achieve a shadow without a border?