Latest 2.0.1
Homepage https://github.com/bernikovich/WebViewWarmUper
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

WKWebView inititalization and first load are very slow. WebViewWarmUper warm-ups WKWebView and UIWebView for faster first load. Download sample project to test it. You can create issue or pull requests if you have any proposals.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate WebViewWarmUper into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'WebViewWarmUper'

Manually

You can simply copy source files from Classes folder (WebViewWarmuper.swift) to your project.

Usage

Standard

First you should call prepare method, it should be called some time before you want to show your web view. In test app we call this method in func application(_ application: didFinishLaunchingWithOptions: ).

import WebViewWarmUper

WKWebViewWarmUper.shared.prepare()

Then, when you need new web view instance:

import WebViewWarmUper

let webView = WKWebViewWarmUper.shared.dequeue()

Advanced (custom WKWebViewConfiguration)

let customWarmUper = WKWebViewWarmUper { () -> WKWebView in
  let configuration = WKWebViewConfiguration()
  // Setup configuration.
  return WKWebView(frame: .zero, configuration: configuration)
}
// Some time after.
let webView = customWarmUper.dequeue()

Legacy

The latest version written in Objective-C is 1.x.

License

WebViewWarmUper is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "WebViewWarmUper",
    "version": "2.0.1",
    "summary": "Boost WKWebView loading speed",
    "homepage": "https://github.com/bernikovich/WebViewWarmUper",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Timur Bernikovich": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_versions": "5.0",
    "frameworks": "UIKit",
    "source": {
        "git": "https://github.com/bernikovich/WebViewWarmUper.git",
        "tag": "2.0.1"
    },
    "source_files": "WebViewWarmUper/Classes/**/*.swift",
    "module_name": "WebViewWarmUper"
}

Pin It on Pinterest

Share This