Solution for Slow Viewing Using Swift's Webview

Asked 2 years ago, Updated 2 years ago, 65 views

It looks slower than browsing with Swift using Webview and Safari on iPhone.
As a way of looking at it, Safari on the iPhone is displayed while loading, while Webview does not appear to display it until loading is complete.

Would it be possible to display it while reading it like Safari?

Also, is there a case where Webview is actually slower than Safari on iPhone?

Please let me know if you know.

swift webview

2022-09-30 17:29

1 Answers

There are three main ways to view websites on the iPhone app.

  • UIWebView
  • WKWebView
  • SFSafariViewController

Each has its own characteristics.

[UIWebView]

  • The oldest WebView
  • Can be added from the storyboard

KWKWebView <

  • WebView Added from iOS 8
  • With the same rendering engine as Safari, JavaScript is about four times faster than UIWebView
  • Code implementation is required because it cannot be added from the storyboard
  • More freedom than the other two

[SFSafariViewController]

  • ViewController for website viewing added from iOS 9
  • If you're just going to use it to view the website, the best way to do it (not if you need to handle your request)
  • Image that Safari is available in the app

In simple terms, WKWebView and SFSafariView Controller are comparable to Safari, but UIWebView is low performance.

The rendering methods, such as server-side rendering and Single Application Page, vary from website to website, so users may be able to feel the load faster.

In any case, if you want iOS to display your website at high speed, you should use WKWebView or SFSafariViewController to suit your needs.

For more information on performance results, see Measure WebView performance with iOS 9!.

I hope this will be helpful.


2022-09-30 17:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.