Skip to content

Instantly share code, notes, and snippets.

@ayanonagon
Created November 8, 2015 05:30
Show Gist options
  • Save ayanonagon/fcb30a1487fe61eb7bcd to your computer and use it in GitHub Desktop.
Save ayanonagon/fcb30a1487fe61eb7bcd to your computer and use it in GitHub Desktop.
guard
let htmlPath = NSBundle.mainBundle().pathForResource("LICENSES", ofType: "html"),
let html = try? String(contentsOfFile: htmlPath, encoding: NSUTF8StringEncoding)
else {
fatalError("LICENSES.html not found.")
}
let webView = WKWebView(frame: CGRectZero, configuration: WKWebViewConfiguration())
webView.loadHTMLString(html, baseURL: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment