-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
376 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# | ||
# Be sure to run `pod spec lint KUIActionSheet.podspec' to ensure this is a | ||
# valid spec and to remove all comments including this before submitting the spec. | ||
# | ||
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html | ||
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
|
||
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# These will help people to find your library, and whilst it | ||
# can feel like a chore to fill in it's definitely to your advantage. The | ||
# summary should be tweet-length, and the description more in depth. | ||
# | ||
|
||
s.name = "WKCookieWebView" | ||
s.version = "0.0.1" | ||
s.summary = "WKCookieWebView" | ||
|
||
# This description is used to generate tags and improve search results. | ||
# * Think: What does it do? Why did you write it? What is the focus? | ||
# * Try to keep it short, snappy and to the point. | ||
# * Write the description between the DESC delimiters below. | ||
# * Finally, don't worry about the indent, CocoaPods strips it! | ||
s.description = "WKWebView with cookie sharing support" | ||
|
||
s.homepage = "https://github.com/Kofktu/WKCookieWebView" | ||
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" | ||
|
||
|
||
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# Licensing your code is important. See http://choosealicense.com for more info. | ||
# CocoaPods will detect a license file if there is a named LICENSE* | ||
# Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. | ||
# | ||
|
||
# s.license = "MIT (example)" | ||
s.license = { :type => "MIT", :file => "LICENSE" } | ||
|
||
|
||
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# Specify the authors of the library, with email addresses. Email addresses | ||
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also | ||
# accepts just a name if you'd rather not provide an email address. | ||
# | ||
# Specify a social_media_url where others can refer to, for example a twitter | ||
# profile URL. | ||
# | ||
|
||
s.author = { "Kofktu" => "[email protected]" } | ||
# Or just: s.author = "Kofktu" | ||
# s.authors = { "Kofktu" => "[email protected]" } | ||
# s.social_media_url = "http://twitter.com/Kofktu" | ||
|
||
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# If this Pod runs only on iOS or OS X, then specify the platform and | ||
# the deployment target. You can optionally include the target after the platform. | ||
# | ||
|
||
# s.platform = :ios | ||
s.platform = :ios, "8.0" | ||
|
||
# When using multiple platforms | ||
# s.ios.deployment_target = "5.0" | ||
# s.osx.deployment_target = "10.7" | ||
# s.watchos.deployment_target = "2.0" | ||
# s.tvos.deployment_target = "9.0" | ||
|
||
|
||
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# Specify the location from where the source should be retrieved. | ||
# Supports git, hg, bzr, svn and HTTP. | ||
# | ||
|
||
s.source = { :git => "https://github.com/Kofktu/WKCookieWebView.git", :tag => s.version.to_s } | ||
|
||
|
||
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# CocoaPods is smart about how it includes source code. For source files | ||
# giving a folder will include any swift, h, m, mm, c & cpp files. | ||
# For header files it will include any header in the folder. | ||
# Not including the public_header_files will make all headers public. | ||
# | ||
|
||
s.source_files = "WKCookieWebView/**/*.{swift}" | ||
# s.exclude_files = "Classes/Exclude" | ||
|
||
# s.public_header_files = "Classes/**/*.h" | ||
|
||
|
||
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# A list of resources included with the Pod. These are copied into the | ||
# target bundle with a build phase script. Anything else will be cleaned. | ||
# You can preserve files from being cleaned, please don't preserve | ||
# non-essential files like tests, examples and documentation. | ||
# | ||
|
||
# s.resource = "icon.png" | ||
# s.resources = "KUIActionSheet/Assets/*.{png,xib}" | ||
|
||
# s.preserve_paths = "FilesToSave", "MoreFilesToSave" | ||
|
||
|
||
# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# Link your library with frameworks, or libraries. Libraries do not include | ||
# the lib prefix of their name. | ||
# | ||
|
||
# s.framework = "SomeFramework" | ||
# s.frameworks = "SomeFramework", "AnotherFramework" | ||
|
||
# s.library = "iconv" | ||
# s.libraries = "iconv", "xml2" | ||
|
||
|
||
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # | ||
# | ||
# If your library depends on compiler flags you can set them in the xcconfig hash | ||
# where they will only apply to your library. If you depend on other Podspecs | ||
# you can include multiple dependencies to ensure it works. | ||
|
||
s.requires_arc = true | ||
|
||
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } | ||
# s.dependency "JSONKit", "~> 1.4" | ||
|
||
end |
82 changes: 82 additions & 0 deletions
82
WKCookieWebView/WKCookieWebView.xcodeproj/xcshareddata/xcschemes/WKCookieWebView.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0900" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C337D6761EFE2CFF00425943" | ||
BuildableName = "WKCookieWebView.framework" | ||
BlueprintName = "WKCookieWebView" | ||
ReferencedContainer = "container:WKCookieWebView.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
language = "" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
language = "" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C337D6761EFE2CFF00425943" | ||
BuildableName = "WKCookieWebView.framework" | ||
BlueprintName = "WKCookieWebView" | ||
ReferencedContainer = "container:WKCookieWebView.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C337D6761EFE2CFF00425943" | ||
BuildableName = "WKCookieWebView.framework" | ||
BlueprintName = "WKCookieWebView" | ||
ReferencedContainer = "container:WKCookieWebView.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.