title: Adding Corner radius for selected edges with shadow using UIBezierPath
body: <p>I am trying to add a shadow on my view. It is having 3 rounded edges. To achieve this UIBezierPath and then setting the CAShapelayer with this path as the mask on the layer of the view. Now, if I'm trying to add shadow on this view, it is not showing. I have gone through a similar question and suggested answers but nothing works in my case. Following is my implementation: </p>
  
  <pre><code>class BubbleView: UIView {
  
  override func draw(_ rect: CGRect) {
      super.draw(rect)
  }
  
  override func layoutSubviews() {
      super.layoutSubviews()
      self.updateContainerLayer()
  }
  
  func updateContainerLayer() {
      let brazierPath: UIBezierPath = UIBezierPath(roundedRect: self.bounds,
                                                   byRoundingCorners: [.bottomRight, .bottomLeft, .topLeft],
                                                   cornerRadii: CGSize(width: 15.0, height: 0.0))
  
      //1
      let shapeLayer = CAShapeLayer()
      shapeLayer.path = brazierPath.cgPath
      self.layer.mask = shapeLayer
  
      //2
      self.layer.shadowColor  = UIColor(r: 0, g: 0, b: 0, alpha: 0.25).cgColor
      self.layer.shadowOpacity = 1.0
      self.layer.shadowOffset = CGSize(width: 0.0, height: 0.5)
      self.layer.shadowRadius = 1.5
      self.layer.shadowPath   = brazierPath.cgPath
      //3
      self.layer.masksToBounds = true
      self.clipsToBounds = false
      //4
      self.layer.shouldRasterize = true
      self.layer.rasterizationScale = UIScreen.main.scale
  
  
  }
  </code></pre>
  
  <p>}</p>