admin管理员组文章数量:1353261
I have the following UIViewRepresentable to load a webview.
struct SViewerWebView: UIViewRepresentable{
var url: String
var token: String
@Binding var isLoading: Bool
func makeCoordinator() -> Coordinator {
Coordinator(self)
}
func makeUIView(context: Context) -> WKWebView {
let webConfiguration = WKWebViewConfiguration()
let webView = WKWebView(frame:.zero,configuration:webConfiguration)
webView.allowsBackForwardNavigationGestures = true
webView.isInspectable = true
webView.navigationDelegate = context.coordinator
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {
guard let urlforRequest = URL(string: url) else {
print("❌ Invalid URL:", url)
return
}
var request = URLRequest(url: urlforRequest)
request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
print("
本文标签:
iosWKWebviewUIViewRepresentableHide Loading text while webview is loadingStack Overflow
版权声明:本文标题:ios - WKWebviewUIViewRepresentable - Hide Loading... text while webview is loading - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1743928589a2563421.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论