I am loading PDF file in PDFView but unable to get PDF File URL from Bundle.
Please check below code :
let pdfView = PDFView(frame: self.view.bounds)
let myFileName = "sample"
guard let url = Bundle.main.url(forResource: myFileName, withExtension: "pdf") else {
return
}
pdfView.document = PDFDocument(url: url)
self.view.addSubview(pdfView)
Every time I am getting nil
in url
.
Edit :
Here is my Project Window:
Am I making any silly mistake ?
Please guide me.
Thanks in Advance.