How would I set the text size of a SwiftUI WebKit View to a @State variable? I have this code that allows me to use WebViews in SwiftUI
import SwiftUI
import WebKit
struct WebView : UIViewRepresentable {
var url : URL;
func makeUIView(context: Context) -> WKWebView {
return WKWebView();
}
func updateUIView(_ uiView: UIViewType, context: Context) {
uiView.loadFileURL(url, allowingReadAccessTo: url)
}
}
I saw this and tried to replicate it,
class Coordinator : NSObject {
func webView(_ webView: WKWebView, js : String) {
webView.evaluateJavaScript(js)
}
}
But I wasn't able to get it to work.
Thanks in advance.