I'm developing a MacOS application which uses an NSVisualEffectView
(named "Rounded View" here) embedded within an application, as seen here:
It is meant to provide a backdrop to an Image View. This works, but despite attempting every method I could possibly find, I cannot get this view's corners to become rounded.
What I've Tried
(Note that I've tried every combination of these things together, too.)
Setting the Mask Image
I created a transparent, high-res PNG with a black rounded square and added it as an asset, setting it in the VisualEffectView's Mask Image property:
This has absolutely no effect on anything.
Setting wantsLayer and cornerRadius
@IBOutlet weak var roundedView: NSVisualEffectView!
...
override func viewWillAppear() {
view.window?.isOpaque = false
roundedView.wantsLayer = true
roundedView.layer!.cornerRadius = 20.0
}
This has no effect either.
Various Compositing Filters
I figured maybe setting a special blend mode would help. None of them force my intended tweaks to opacity to take effect.