Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haifengkao/ywebview
WKWebview with persistent cookies support
https://github.com/haifengkao/ywebview
Last synced: about 1 month ago
JSON representation
WKWebview with persistent cookies support
- Host: GitHub
- URL: https://github.com/haifengkao/ywebview
- Owner: haifengkao
- License: mit
- Created: 2016-06-26T11:32:12.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-01-05T19:35:02.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T15:44:22.882Z (2 months ago)
- Language: Objective-C
- Size: 462 KB
- Stars: 104
- Watchers: 9
- Forks: 26
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YWebView
[![CI Status](http://img.shields.io/travis/haifengkao/YWebView.svg?style=flat)](https://travis-ci.org/haifengkao/YWebView)
[![Coverage Status](https://coveralls.io/repos/haifengkao/YWebView/badge.svg?branch=master&service=github)](https://coveralls.io/github/haifengkao/YWebView?branch=master)
[![Version](https://img.shields.io/cocoapods/v/YWebView.svg?style=flat)](http://cocoapods.org/pods/YWebView)
[![License](https://img.shields.io/cocoapods/l/YWebView.svg?style=flat)](http://cocoapods.org/pods/YWebView)
[![Platform](https://img.shields.io/cocoapods/p/YWebView.svg?style=flat)](http://cocoapods.org/pods/YWebView)The primary codes are copied from an answer of [SO](http://stackoverflow.com/a/32845148/912645).
All cookies will be loaded from `NSHTTPCookieStorage`. When a web page is loaded, its cookies will be save to NSHTTPCookieStorage as well.
This method allows cookie sharing among multiple WKWebView and UIWebView.If you want to remove all cookies, use
```objc
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in cookieStorage.cookies) {
[cookieStorage deleteCookie:cookie];
}
```## Usage
Just use YWebView as the ordinary WKWebView.## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
iOS 8.0 (the minimum requirement for WKWebView)## Installation
YWebView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "YWebView"
```## Author
Hai Feng Kao, [email protected]
## License
YWebView is available under the MIT license. See the LICENSE file for more info.