I am building a Mac application using Swift. Therefore, I want to make WKWebView transparent, so it displays the text of the loaded HTML, but the background of my underlying NSWindow is visible. I tried
webView.layer?.backgroundColor = NSColor.clearColor().CGColor;
which had no effect. WKWebView inherits from NSView, but I don't know if this helps.
Another solution would be to insert NSVisualEffectView as the background of the WebView, but I don't know how to do it, either!
swift appkit macos
danielbuechele
source share