make pdfwrapper public

This commit is contained in:
Satindar Dhillon
2022-02-23 16:27:00 -08:00
parent 5e4502719e
commit b1655c06e4

View File

@ -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