I have one big CGRect and two small CGRect inside. I want to draw the big CGRect in red and to form two transparent holes corresponding to the small CGRect.
I am not able to do it. I have tried to use NSBezierPath but in macOS there is no method NSBezierPath.CGPath like in UIBezierPath for iOS.
You don't have to use Core Graphics. You can create a
NSView
subclass and juststroke
/fill
the path indraw(_:)
. In Swift 3:You can then add that view programmatically, or you can make it
@IBDesignable
and add it directly on your storyboard.