alte WebView vor iOS 26 und SafariView mit controls
This commit is contained in:
parent
42b110637a
commit
0c3eaebc80
2 changed files with 18 additions and 3 deletions
Binary file not shown.
|
|
@ -8,7 +8,7 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
import WebKit
|
import WebKit
|
||||||
|
import SafariServices
|
||||||
|
|
||||||
|
|
||||||
struct WebAppView: View {
|
struct WebAppView: View {
|
||||||
|
|
@ -24,7 +24,9 @@ struct WebAppView: View {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Text("please update to iOS 26.0 or later")
|
Text("please update to iOS 26.0 or later")
|
||||||
WebOldView(url: URL(string: "https://ai.irohlf.de")!)
|
// WebOldView(url: URL(string: "https://ai.irohlf.de")!)
|
||||||
|
SafariView(url: URL(string: "https://cloud.irohlf.de/s/oWYjxWJN9WwJsWq")!)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +36,7 @@ struct WebAppView: View {
|
||||||
|
|
||||||
struct WebOldView: UIViewRepresentable {
|
struct WebOldView: UIViewRepresentable {
|
||||||
let url: URL
|
let url: URL
|
||||||
typealias UIViewType = WKWebView
|
//typealias UIViewType = WKWebView
|
||||||
func makeUIView(context: Context) -> WKWebView {
|
func makeUIView(context: Context) -> WKWebView {
|
||||||
.init()
|
.init()
|
||||||
}
|
}
|
||||||
|
|
@ -43,6 +45,19 @@ struct WebOldView: UIViewRepresentable {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct SafariView: UIViewControllerRepresentable {
|
||||||
|
|
||||||
|
let url: URL
|
||||||
|
/// typealias UIViewControllerType = SFSafariViewController
|
||||||
|
|
||||||
|
func makeUIViewController(context: Context) -> SFSafariViewController {
|
||||||
|
.init(url: url)
|
||||||
|
}
|
||||||
|
func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue