Skip to content

Instantly share code, notes, and snippets.

@Ceri-anne
Last active November 25, 2017 21:58
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
webViewDidFinish
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
let css = "body { background-color : #ff0000 }"
let js = "var style = document.createElement('style'); style.innerHTML = '\(css)'; document.head.appendChild(style);"
webView.evaluateJavaScript(js, completionHandler: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment