From dff2a24483063ed9ea7e53ccab8bb58303e53ae9 Mon Sep 17 00:00:00 2001 From: Daniel Saidi Date: Fri, 1 Apr 2022 00:57:11 +0200 Subject: [PATCH] Move web view representable into web view --- Sources/WebViewKit/WebView.swift | 6 +++++ Sources/WebViewKit/WebViewRepresentable.swift | 25 ------------------- 2 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 Sources/WebViewKit/WebViewRepresentable.swift diff --git a/Sources/WebViewKit/WebView.swift b/Sources/WebViewKit/WebView.swift index 5de203b..0a777ef 100644 --- a/Sources/WebViewKit/WebView.swift +++ b/Sources/WebViewKit/WebView.swift @@ -6,6 +6,12 @@ // Copyright © 2022 Daniel Saidi. All rights reserved. // +#if os(iOS) +typealias WebViewRepresentable = UIViewRepresentable +#elseif os(macOS) +typealias WebViewRepresentable = NSViewRepresentable +#endif + #if os(iOS) || os(macOS) import SwiftUI import WebKit diff --git a/Sources/WebViewKit/WebViewRepresentable.swift b/Sources/WebViewKit/WebViewRepresentable.swift deleted file mode 100644 index e8d4176..0000000 --- a/Sources/WebViewKit/WebViewRepresentable.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// WebViewRepresentable.swift -// WebViewKit -// -// Created by Daniel Saidi on 2022-03-24. -// Copyright © 2022 Daniel Saidi. All rights reserved. -// - -import SwiftUI - -#if os(iOS) - -/** - This typealias is used to bridge UIKit and AppKit wrappers. - */ -typealias WebViewRepresentable = UIViewRepresentable - -#elseif os(macOS) - -/** - This typealias is used to bridge UIKit and AppKit wrappers. - */ -typealias WebViewRepresentable = NSViewRepresentable - -#endif