Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created Feb 7, 2021
Embed
What would you like to do?
import SwiftUI
import WebKit
struct WebView: UIViewRepresentable {
let webView = WKWebView()
@Binding var htmlString: String
func makeUIView(context: Context) -> WKWebView {
webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {
webView.loadHTMLString(htmlString, baseURL: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment