From b1655c06e43441f98fb482df52118e75cefa2d0a Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 23 Feb 2022 16:27:00 -0800 Subject: [PATCH] make pdfwrapper public --- .../Views/LinkedItemDetail/PDFWrapperView.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/LinkedItemDetail/PDFWrapperView.swift b/apple/OmnivoreKit/Sources/Views/LinkedItemDetail/PDFWrapperView.swift index 1cee80cb8..9ca637bc6 100644 --- a/apple/OmnivoreKit/Sources/Views/LinkedItemDetail/PDFWrapperView.swift +++ b/apple/OmnivoreKit/Sources/Views/LinkedItemDetail/PDFWrapperView.swift @@ -2,10 +2,14 @@ import PDFKit import SwiftUI #if os(macOS) - struct PDFWrapperView: NSViewRepresentable { + public struct PDFWrapperView: NSViewRepresentable { let pdfURL: URL - func makeNSView(context _: Context) -> PDFView { + public init(pdfURL: URL) { + self.pdfURL = pdfURL + } + + public func makeNSView(context _: Context) -> PDFView { let pdfView = PDFView() if let document = PDFDocument(url: pdfURL) { pdfView.document = document @@ -13,7 +17,7 @@ import SwiftUI return pdfView } - func updateNSView(_: PDFView, context _: Context) {} + public func updateNSView(_: PDFView, context _: Context) {} } #endif