swift3 - Not getting file URL from bundle -
i loading pdf file in pdfview unable pdf file url 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 getting nil
in url
.
edit :
here project window:
am making silly mistake ?
please guide me.
thanks in advance.
i got problem not sure it's in latest xcode in xcode 9.5(beta) while adding external file in project , select bundle target still not adding bundle.
solution :
you need click on file want add target bundle , check manually property window.
please check below screen shot more detail.
while adding file project have checked still not adding in selected target.
now need check target , working expected.
not sure bug or new update in latest xcode.
but problem solved.
thanks.
Comments
Post a Comment