Latest 0.0.1
Homepage https://github.com/Kofktu/WKCookieWebView
License MIT
Platforms ios 8.0, requires ARC
Authors
  • WKWebView with cookie sharing support

Requirements

  • iOS 8.0+
  • XCode 8.0+
  • Built with Swift 3

Installation

CocoaPods

WKCookieWebView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'WKCookieWebView'

Carthage

For iOS 8+ projects with Carthage

github "Kofktu/WKCookieWebView"

Usage

navigationDelegate -> wkNavigationDelegate

  • You should use wkNavigationDelegate instead of navigationDelegate.
  • However, the three methods of WKNavigationDelegate must use closure instead of delegate.
// @available(iOS 8.0, *)
// optional public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void)
public var onDecidePolicyForNavigationAction: ((WKWebView, WKNavigationAction, @escaping (WKNavigationActionPolicy) -> Swift.Void) -> Void)?

// @available(iOS 8.0, *)
// optional public func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Swift.Void)
public var onDecidePolicyForNavigationResponse: ((WKWebView, WKNavigationResponse, @escaping (WKNavigationResponsePolicy) -> Swift.Void) -> Void)?

// @available(iOS 8.0, *)
// optional public func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.Void)
public var onDidReceiveChallenge: ((WKWebView, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.Void) -> Void)?

When HTTPCookieStorage is updated

public var onUpdateCookieStorage: ((WKCookieWebView) -> Void)?

If you need to set WKWebViewConfiguration

let webView = WKCookieWebView(frame: frame, configurationBlock: { (configuration) in
    // customize configuration
})

Authors

Taeun Kim (kofktu), [email protected]

License

WKCookieWebView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "WKCookieWebView",
    "version": "0.0.1",
    "summary": "WKCookieWebView",
    "description": "WKWebView with cookie sharing support",
    "homepage": "https://github.com/Kofktu/WKCookieWebView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kofktu": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Kofktu/WKCookieWebView.git",
        "tag": "0.0.1"
    },
    "source_files": "WKCookieWebView/**/*.{swift}",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This