Corner radius image Swift
I'm trying to make this corner radius image...it's not exactly the same shape of the image..any easy answer instead of trying random numbers of width and height ? thanks alot let rectShape = CAShapeLayer() rectShape.bounds = self.mainImg.frame rectShape.position = self.mainImg.center rectShape.path = UIBezierPath(roundedRect: self.mainImg.bounds, byRoundingCorners: [.bottomLeft , .bottomRight ], cornerRadii: CGSize(width: 50, height: 4)).cgPath You can use QuadCurve to get the design you want. Here is a Swift @IBDesignable class that lets you specify the image and the "height" of the rounding