title: How to add Curve left and right side in UIView for swift
body: <p>I tried to add a curve but not working.</p>
  <p>I have attached the image left side is given by the designer, the right side I have done in swift.</p>
  <p>here the if I add corner radius not working for the curve if add curve corner radius not working.</p>
  <p>I have added left side and right side separate views, how it's possible to achieve the remove the super view background-color and curve.</p>
  <pre><code>extension UIView {
  
     func roundCorners(
        corners: UIRectCorner,
        radius: CGFloat
     ) {
        let path = UIBezierPath(
           roundedRect: bounds,
           byRoundingCorners: corners,
           cornerRadii: CGSize(
              width: radius,
              height: radius
           )
        )
  
        let mask = CAShapeLayer()
        mask.path = path.cgPath
        layer.mask = mask
     }
  }
  
  // here I am using on UITableviewCell in layoutSubview 
  
      leftCurve.roundCorners(corners: [.topRight,.bottomRight], radius: 20)        
      rightCurver.roundCorners(corners: [.topLeft,.bottomLeft], radius: 20)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ya496.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ya496.png" alt="enter image description here" /></a></p>