title: How to add shadow to UIView?
body: <p><a href="https://i.stack.imgur.com/9gn6x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9gn6x.png" alt="Result which i get"></a>For <code>UIView</code> I'm giving corner radius for two sides and adding drop shadow. Now, I'm getting corner radius for two sides but not shadow.</p>
  
  <p>Here is the code which I have used:</p>
  
  <pre><code>@IBOutlet var myView: UIView!
  
  override func viewDidLoad() {
      super.viewDidLoad()
     let shadowpath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: 
     myView.frame.height, height: myView.frame.height), byRoundingCorners: 
     [.topRight, .bottomRight], cornerRadii: CGSize(width: 58.0, height: 0.0))
  
      myView.layer.shadowColor = UIColor.black.cgColor
      myView.layer.shadowOffset = CGSize(width: 0.5, height: 0.4)  //Here you 
      control x and y
      myView.layer.shadowOpacity = 0.5
      myView.layer.shadowRadius = 5.0 //Here your control your blur
      myView.layer.masksToBounds =  false
      myView.layer.shadowPath = shadowpath.cgPath
  </code></pre>
  
  <p>Screenshot:
  <a href="https://i.stack.imgur.com/IvSYb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IvSYb.png" alt="enter image description here"></a></p>