title: How to add shadow to navigation bar and hide border in Swift?
body: <p>I am currently adding a shadow to my navigation bar using the following code:</p>
  <pre class="lang-swift prettyprint-override"><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
  </code></pre>
  <p>This produces the following result:
  <a href="https://i.stack.imgur.com/g7VTv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g7VTv.jpg" alt="enter image description here" /></a>
  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?</p>