diff --git a/Sources/PreviewDevice/CocoaPreivew/NSViewControllerPreview.swift b/Sources/PreviewDevice/CocoaPreivew/NSViewControllerPreview.swift new file mode 100644 index 0000000..93dde15 --- /dev/null +++ b/Sources/PreviewDevice/CocoaPreivew/NSViewControllerPreview.swift @@ -0,0 +1,33 @@ +// +// NSViewControllerPreview.swift +// +// +// Created by Anton Paliakou on 10/15/21. +// + +#if canImport(Cocoa) && canImport(SwiftUI) +import SwiftUI +import Cocoa + +public struct NSViewControllerPreview: NSViewControllerRepresentable { + + // MARK: - Properties + + private let viewController: NSViewController + + // MARK: - Init + + public init(viewController: NSViewController) { + self.viewController = viewController + } + + // MARK: - UIViewControllerRepresentable + + public func makeNSViewController(context: Context) -> NSViewController { + viewController + } + + public func updateNSViewController(_ nsViewController: NSViewController, context: Context) { + } +} +#endif diff --git a/Sources/PreviewDevice/UIKitPreview/UIViewControllerPreview.swift b/Sources/PreviewDevice/UIKitPreview/UIViewControllerPreview.swift index 695b7ac..4fbef25 100644 --- a/Sources/PreviewDevice/UIKitPreview/UIViewControllerPreview.swift +++ b/Sources/PreviewDevice/UIKitPreview/UIViewControllerPreview.swift @@ -1,5 +1,5 @@ // -// File.swift +// UIViewControllerPreview.swift // // // Created by Anton Paliakou on 10/15/21.