I'm trying to create a custom NSWindow
, so I've created one with the proper borderless window mask and that works. I provide my own content view which is fine. But what I'm trying to do is draw with rounded corners that also clip subviews to those corners. Is this possible?
In my content view, I can override drawRect:
and draw a path with round corners, but when I add subviews to this, they aren't clipped.
I can instead make my content view layer-backed and give it a corner radius (with masksToBounds
set to YES
) but when I add subviews, they're still not clipped by my round corners.
Is there a way to do this? Or some way to draw an NSWindow without a title bar and which I'd have full control over the drawing, and yet maintain the rounded, clipping corners?