I have a WKWebView in my view
@IBOutlet weak var htmlWKWebView: WKWebView!
I want to change background color to red. I tried:
htmlWKWebView.wantsLayer = true
htmlWKWebView.layer?.masksToBounds = true
htmlWKWebView.layer?.isOpaque = false
htmlWKWebView.layer?.backgroundColor = NSColor.red.cgColor
Nothing worked. Only this:
htmlWKWebView.setValue(false, forKey: "drawsBackground") made background transparent. But background color not set