diff --git a/Sources/WebView/WebView.swift b/Sources/WebView/WebView.swift index d609e2e..8f0bf49 100644 --- a/Sources/WebView/WebView.swift +++ b/Sources/WebView/WebView.swift @@ -12,29 +12,24 @@ public struct WebView: View { } } -#if os(iOS) // MARK: - UIViewRepresentable +#if os(iOS) extension WebView: UIViewRepresentable { public func makeUIView(context: UIViewRepresentableContext) -> WKWebView { webView } - public func updateUIView(_ view: WKWebView, context: UIViewRepresentableContext) { - - } + public func updateUIView(_ view: WKWebView, context: UIViewRepresentableContext) {} } #endif -#if os(macOS) // MARK: - NSViewRepresentable +#if os(macOS) extension WebView: NSViewRepresentable { - public typealias NSViewType = NSViewContainerView - public func makeNSView(context: NSViewRepresentableContext) -> WKWebView { webView } - public func updateNSView(_ view: WKWebView, context: UIViewRepresentableContext) { - } + public func updateNSView(_ view: WKWebView, context: NSViewRepresentableContext) {} } #endif