This code has functioned flawlessly for years, however after updating to Xcode 15.4 (Beta 1), the WebView just isn’t rendering the content material. I’ve up to date to Xcode 15.4 as a result of I am having this difficulty on Xcode cloud since Xcode 15 launched. As a short lived measure, I’ve switched the URL to google.com for testing functions.
That is the code that I am utilizing on my mission to load a URL however nothing is loading on iOS 17.5 (simulator), and it does load on iOS 17.4 (simulator and actual gadget).
import WebKit
import SwiftUI
struct LoginView: View {
var physique: some View {
NavigationView {
VStack {
WebView(urlString: "https://google.com")
.body(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
}
.navigationTitle("Net View")
}
}
#Preview {
LoginView()
}
struct WebView: UIViewRepresentable {
let urlString: String
func makeUIView(context: Context) -> WKWebView {
let webView = WKWebView()
webView.navigationDelegate = context.coordinator
return webView
}
func updateUIView(_ uiView: WKWebView, context: Context) {
if let url = URL(string: urlString) {
let request = URLRequest(url: url)
uiView.load(request)
}
}
}
iPhone 15 Professional Max iOS 17.5 (Simulator)
iPhone 15 Professional Max iOS 17.4 (Simulator)
Xcode Cloud UITests utilizing iPhone 15 Professional Max iOS 17.4 (Simulator)
I additionally observed that Xcode Cloud has been having issues rendering the WebView as you’ll be able to see within the picture under: