How to load CSS file by using URL in WKWebView
问题 I want to inject CSS by using URL link , Working Working below code, If I store CSS file in Bundle path of project, lazy var webView: WKWebView = { guard let path = Bundle.main.path(forResource: "style", ofType: "css") else { return WKWebView() } let cssString = try! String(contentsOfFile: path).components(separatedBy: .newlines).joined() let source = """ var style = document.createElement('style'); style.innerHTML = '\(cssString)'; document.head.appendChild(style); """ let preferences =