so here is the code that is working well
let path = UIBezierPath(roundedRect:viewToRound.bounds,
byRoundingCorners:[.topRight, .bottomLeft],
cornerRadii: CGSize(width: 20, height: 20))
let maskLayer = CAShapeLayer()
maskLayer.path = path.cgPath
viewToRound.layer.mask = maskLayer
But I need to use this many times in my codes So I created the class for view and want to use this in IBInspectable to be optional each edges to change the corners radiuses in story Board so I used this But it does not shown in story board
@IBInspectable
open var cornerEdges: CGSize {
get {
let path = UIBezierPath(roundedRect:self.bounds,
byRoundingCorners:[.topRight, .bottomLeft],
cornerRadii: CGSize(width: 20, height: 20))
let maskLayer = CAShapeLayer()
maskLayer.path = path.cgPath
self.layer.mask = maskLayer
return maskLayer.path as! CGSize
}
set(value) {
maskLayer.path = value
}
}
so what should I do for doing this in my codes ?