Is there a way to set cornerRadius for only bottom-left,bottom-right and top-left corner of a UIView?
I tried the following, but it ended up making the view disappea
Tested in xcode 8 and swift 3
extension UIView {
func roundCorners(corners:UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
mask.path = path.cgPath
self.layer.mask = mask
}
}
And use like this
YourView.roundCorners([.topLeft, .bottomLeft], radius: 10)