-
-
Save sturdysturge/f6fccfbba0febf8d3a8626eb3af8a497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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