mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
make pdfwrapper public
This commit is contained in:
parent
5e4502719e
commit
b1655c06e4
1 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue