PDF file not shown at runtime

I have an qpplication that displays a PDF file as a webView.load.

The strange is that the PDF is shown with the simulator (iPad Air 2) but when running in the device, the PDF file is not displayed and the app does not set any error.

Any help is welcome.

Is this a local PDF file? If so, make sure you load it using the

loadFileURL(_:allowingReadAccessTo:)
method, which extends the web view rendering process’s sandbox to allow it to access your file. For example:
let url = Bundle.main.url(forResource: "test", withExtension: "pdf")!
self.webView.loadFileURL(url, allowingReadAccessTo: url)

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
PDF file not shown at runtime
 
 
Q