文章目录
from : https://medium.com/@mdyamin/swiftui-mastering-webview-5790e686833e
struct ContentView : UIViewRepresentable
{
func makeUIView(context: UIViewRepresentableContext<ContentView>) -> WKWebView
{
return WKWebView()
}
func updateUIView(_ uiView: WKWebView, context: UIViewRepresentableContext<ContentView>)
{
let request = URLRequest(url:URL(string: "https://apple.com")!)
uiView.load(request)
}
}