I need to round top corners of a view with any value and also bottom corners of the same view with a different value. Here, I have the code I thought it would solve this. But it doesn't work... Any idea?
bottomPath = UIBezierPath(roundedRect:self.bounds,
byRoundingCorners:[.bottomLeft, .bottomRight],
cornerRadii: CGSize(width: radius, height: radius))
topPath = UIBezierPath(roundedRect:self.bounds,
byRoundingCorners:[.topLeft, .topRight],
cornerRadii: CGSize(width: radius, height: radius))
bottomPath.append(topPath)
maskLayer = CAShapeLayer()
maskLayer?.path = bottomPath.cgPath
self.layer.mask = maskLayer
If I comment bottomPath or topPath I get top or bottom corners rounded, but never both of them Thank you