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?
Since then, we've recommended that you adopt WKWebView instead of UIWebView and WebView — both of which were formally deprecated. New apps containing these frameworks are no longer accepted by the App Store.
WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features.
Difference Between UIWebview and WKWebViewUIWebview is a part of UIKit, so it is available to your apps as standard. You don't need to import anything, it will we there by default. But WKWebView is run in a separate process to your app,. You need to import Webkit to use WKWebView in your app.
The WKWebView already contains a scrollview. All you need to do is create the refresh control, assign a target function that will get called when a user initiates a refresh, and attach the refresh control to the scrollview.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With