How to fix it?
Errors: "Cannot find type 'UIViewRepresentable' in scope" "Cannot find type 'Context' in scope" "Cannot find type 'Context' in scope"
I tried: Re-installed the Xcode Re-started computer
Great thanks.
import SwiftUI import PDFKit
struct PDFViewerView: UIViewRepresentable { var url: URL
func makeUIView(context: Context) -> PDFView {
let pdfView = PDFView()
pdfView.document = PDFDocument(url: self.url)
return pdfView
}
func updateUIView(_ uiView: PDFView, context: Context) {
// Update the view.
}
}
Xcode Version 15.0.1 (15A507)