Hello,
I'm trying to show a pdf inside my app, using webkit, with the code below. When I open the app, everything is fine, but after I'm switching to another tab (another page), the content of the pdf doesn't show up (just the pages don't show up, but page counter is still there).
view(request: URLRequest(url: URL(string: "[the url to the pdf file]")!)).previewLayout(.fixed(width: .infinity, height: .infinity))
.tabItem {
Image("Lyzeum")
Text("Lyzeum")
}
Also the URLRequest function:
struct view : UIViewRepresentable {
let request: URLRequest
func makeUIView(context: Context) -> WKWebView {
return WKWebView()
}
func updateUIView(_ uiView: WKWebView, context: Context) {
uiView.load(request)
}
}