Hi! I'm creating an app for iOS and I want just to display a pdf from an external url with the width of 300 and height of 500.
I tried with UiWebView but it is no longer supported.
import SwiftUI
let webView = UIWebView(frame: CGRect(x: 10, y: 10, width: 500, height: 300))
let targetURL = NSURL(string: "https://www.example.com/document.pdf")!
let request = NSURLRequest(URL: targetURL)
webView.loadRequest(request)
struct StundenplanCard: View {
var body: some View {
VStack(spacing: 20) {
Text("Gimnazium")
// here should be displayed the pdf
}
}
}
struct StundenplanCard_Previews: PreviewProvider {
static var previews: some View {
StundenplanCard().previewLayout(.fixed(width: 320, height: 640))
}
}