I want a specific corner of NSView with radios but I can't figure it out how to do it. for all corners, I am using
class StyledButton: NSView {
let roundLayer: CALayer = CALayer()
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
setup()
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
func setup() {
self.wantsLayer = true
self.layer?.addSublayer(roundLayer)
roundLayer.frame = self.bounds
roundLayer.cornerRadius = 3
roundLayer.backgroundColor = NSColor.redColor().CGColor
}
}
You can use
maskedCorners:Here is an example to round only
bottom right and top rightcorners: