WKWebView on iOS 14 only loads content after a significant delay

Viewed 4269

There seems to be some issue with loading content in WKWebViews in iOS 14. Whenever something is loaded (either a webpage or html string) it takes 25 seconds before the loading actually starts.

I've tried this with a production project and a couple boilerplate WKWebView projects written in Swift and Objective-C, all of them have the same 25 second delay.

This happens in the simulator for both iPhone and iPad on two Macs, both running Catalina and Xcode 12 beta 3.

I haven't tried this on an actual device yet as my primary phone is the only device I have that is capable of running iOS 14 and I prefer not to install iOS 14 on it just to check if this issue is present.

Has anyone else seen this issue?

1 Answers

After two nights working on this thinking it was a mistake I made in SwiftUI (WKWebView inside UIViewRepresentable), I came to the conclusion that this is an issue with iOS 14, but only on the simulator. Not fixed in Xcode 12 beta 4.

There is no delay in iOS 13 on the simulator. You can easily test this by opening Safari in a simulator running iOS 13 and in a second simulator running iOS 14. Any webpage in Safari iOS 13 will open almost instantly. Any webpage in Safari iOS 14 will open with a delay of 20-30 seconds (unless it is a link you click on the website itself).

There is also no delay if you open a webpage in WKWebView or Safari on a real device with iOS 14 (tested with iOS 14 beta 4).

I reported this issue to Apple via the Feedback Assistent app.

[UPDATE] Seems fixed in Xcode 12 beta 5: no longer a delay in the simulator.

Related