Skip to content

Commit

Permalink
update to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kofktu committed Jun 29, 2017
1 parent f5eeafe commit 3754125
Showing 1 changed file with 71 additions and 1 deletion.
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# WKCookieWebView
WKWebView with cookie sharing support

- WKWebView with cookie sharing support

## Requirements
- iOS 8.0+
- XCode 8.0+
- Built with Swift 3

## Installation

#### CocoaPods
WKCookieWebView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'WKCookieWebView'
```

#### Carthage
For iOS 8+ projects with [Carthage](https://github.com/Carthage/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.



```swift
// @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

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

#### If you need to set WKWebViewConfiguration

```swift
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.

0 comments on commit 3754125

Please sign in to comment.