LoginSignup
5
4

More than 5 years have passed since last update.

WKWebViewに変更する理由

Posted at

なぜUIWebiewからWKWebViewに変更するか
iOS2からあったUIWebViewiOS8から登場したWKWebView、この違い

そもそもappleがWKWebViewを推奨

storyboard上からUIWebViewが消えました。
コード上からもdepracatedになる日も近いかもです。

Note
In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView. Additionally, consider setting the WKPreferences property javaScriptEnabled to false if you render files that are not supposed to run JavaScript.

WKWebViewの方がクラッシュ率が下がる

WKWebViewの方がクラッシュが減ります。

SDK側とアプリで別々だとクッキー同期の遅延が発生する

UIWebViewとWKWebViewでクッキーは同期されるが、同期に時間がかかるためそれによる影響がある。なのでSDKでWKWebViewなのにアプリ本体がUIWebViewだと様々な悪影響がある可能性がある。

safari native JavaScriptの最適化をしている

つまりjsの実行速度がアップ。さらに

その他

WKWebViewだとスライド進む、戻るをしたりプログラスバー(ロードのやつ)がプロパティを設定するだけでできたりする。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4