I am using WKWebView to Load PDF file from the bundle, and it works fine in iPad Device and simulator both, but when I debug that same code for Mac OS app with the help of Mac Catalyst, it just shows Blank white screen In Mac App Simulator, nothing happens.
Here is my code to load pdf from Bundle : -
import UIKit
import WebKit
class ViewController: UIViewController,WKNavigationDelegate{
@IBOutlet weak var webKit: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
if let pdf = Bundle.main.url(forResource: "sample", withExtension: "pdf", subdirectory: nil, localization: nil) {
let req = NSURLRequest(url: pdf)
webKit.load(req as URLRequest)
}
}
and it throws this error in console :-
Could not create a 'com.apple.iphone.axserver-systemwide' sandbox extension
Even though I have configured app sandbox :-
Have a look here
I am using - Xcode 11.1 - macOS 10.15
WKWebView will not (currently) display PDF's using Catalyst on macOS. Use PDFView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With