AutorÃa | Ultima modificación | Ver Log |
//// PDFKitRepresentedView.swift// twogetskills//// Created by Efrain Yanez Recanatini on 4/26/22.//import PDFKitimport SwiftUIstruct PDFKitRepresentedView: UIViewRepresentable {typealias UIViewType = PDFViewlet url: URLinit(_ url: URL) {self.url = url}func makeUIView(context _: UIViewRepresentableContext<PDFKitRepresentedView>) -> UIViewType {// Create a `PDFView` and set its `PDFDocument`.let pdfView = PDFView()pdfView.document = PDFDocument(url: url)pdfView.autoScales = truereturn pdfView}func updateUIView(_ pdfView: UIViewType, context _: UIViewRepresentableContext<PDFKitRepresentedView>) {pdfView.document = PDFDocument(url: url)}}