9

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?

Daniel Andersson
  • 3,083
  • 2
  • 11
  • 9
  • 1
    "Has anyone else seen this issue" - Yup, just spent an hour trying to work around it, failed completely to do so. I was trying to read a file from the app bundle; is that the case with you, or is this also happening for remote URLs? – matt Jul 31 '20 at 14:21
  • 1
    I have the same issue during loading WKWebView in the simulator, but it works well on the real device. – Vlad Aug 02 '20 at 06:00
  • 1
    @matt I'm seeing the issue with both local and remote urls in the simulator. I was able to install iOS 14 on an iPad and I couldn't reproduce the issue. Seems to be simulator only. – Daniel Andersson Aug 03 '20 at 06:31
  • 1
    And not just WKWebView. Mobile Safari has the same problem. – matt Aug 03 '20 at 12:51

1 Answers1

5

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.