Skip to content

Instantly share code, notes, and snippets.

@mycroftcanner
Created October 13, 2019 19:04
Show Gist options
  • Save mycroftcanner/93897d2da7bde4a0efcb3ab5f3e56581 to your computer and use it in GitHub Desktop.
Save mycroftcanner/93897d2da7bde4a0efcb3ab5f3e56581 to your computer and use it in GitHub Desktop.
webView
let userScript = WKUserScript(source: source,
injectionTime: .atDocumentEnd,
forMainFrameOnly: true)
let userContentController = WKUserContentController()
userContentController.addUserScript(userScript)
let configuration = WKWebViewConfiguration()
configuration.userContentController = userContentController
let webView = WKWebView(frame: .zero,
configuration: configuration)
webView.isOpaque = false
webView.backgroundColor = .clear
return webView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment