From 28a660dae4e8884045a79b27ef8944129c6432d6 Mon Sep 17 00:00:00 2001 From: "seongho.hong" Date: Mon, 6 Jan 2020 20:46:45 +0900 Subject: [PATCH 1/7] Update script to add expiresDate --- WKCookieWebView/WKCookieWebView.swift | 53 ++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/WKCookieWebView/WKCookieWebView.swift b/WKCookieWebView/WKCookieWebView.swift index 527de60..3261c98 100644 --- a/WKCookieWebView/WKCookieWebView.swift +++ b/WKCookieWebView/WKCookieWebView.swift @@ -48,9 +48,12 @@ open class WKCookieWebView: WKWebView { private func userContentWithCookies() -> WKUserContentController { let userContentController = configuration.userContentController - if let cookies = HTTPCookieStorage.shared.cookies { - let now = Date() + if let cookies = HTTPCookieStorage.shared.cookies, cookies.count > 0 { + // https://stackoverflow.com/a/32845148 + var scripts: [String] = ["var cookieNames = document.cookie.split('; ').map(function(cookie) { return cookie.split('=')[0] } )"] + let now = Date() + for cookie in cookies { if let expiresDate = cookie.expiresDate, now.compare(expiresDate) == .orderedDescending { // Expire @@ -58,18 +61,18 @@ open class WKCookieWebView: WKWebView { continue } - let value = "document.cookie='\(cookie.name)=\(cookie.value);domain=\(cookie.domain);path=\(cookie.path);';" - userContentController.addUserScript(WKUserScript(source: value, - injectionTime: .atDocumentStart, - forMainFrameOnly: false)) - updatedCookies.append(cookie.name) + scripts.append("if (cookieNames.indexOf('\(cookie.name)') == -1) { document.cookie='\(cookie.javaScriptString)'; }") } + + let mainScript = scripts.joined(separator: ";\n") + userContentController.addUserScript(WKUserScript(source: mainScript, + injectionTime: .atDocumentStart, + forMainFrameOnly: false)) } return userContentController - } - + private func update(webView: WKWebView) { // WKWebView -> HTTPCookieStorage webView.evaluateJavaScript("document.cookie;") { [weak self] (result, error) in @@ -265,3 +268,35 @@ extension WKCookieWebView: WKNavigationDelegate { } } + +// MARK: - HTTPCookie + +private extension HTTPCookie { + + var javaScriptString: String { + var properties = [ + "\(name)=\(value)", + "domain=\(domain)", + "path=\(path)" + ] + + if isSecure { + properties.append("secure=true") + } + + if let expiresDate = expiresDate { + properties.append("expires=\(HTTPCookie.dateFormatter.string(from: expiresDate))") + } + + return properties.joined(separator: "; ") + } + + private static let dateFormatter: DateFormatter = { + let dateFormatter = DateFormatter() + dateFormatter.locale = Locale(identifier: "en_US") + dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) + dateFormatter.dateFormat = "EEE, dd MMM yyyy HH:mm:ss zzz" + return dateFormatter + }() + +} From 94cb018d0325c64fc9b37322a389ec4c1816d40c Mon Sep 17 00:00:00 2001 From: kofktu Date: Wed, 15 Jan 2020 14:34:50 +0900 Subject: [PATCH 2/7] [#9] set/delete cookie completion --- WKCookieWebView/WKCookieWebView.swift | 91 +++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/WKCookieWebView/WKCookieWebView.swift b/WKCookieWebView/WKCookieWebView.swift index 3261c98..1942732 100644 --- a/WKCookieWebView/WKCookieWebView.swift +++ b/WKCookieWebView/WKCookieWebView.swift @@ -90,6 +90,12 @@ open class WKCookieWebView: WKWebView { private func update(with cachedCookies: [HTTPCookie]?, documentCookie: String, host: String) { let cookieValues = documentCookie.components(separatedBy: "; ") + guard cookieValues.isEmpty == false else { + return + } + + let dispatchGroup = DispatchGroup() + for value in cookieValues { var comps = value.components(separatedBy: "=") if comps.count < 2 { continue } @@ -112,8 +118,11 @@ open class WKCookieWebView: WKWebView { self.delete(cookie: localCookie) if let cookie = HTTPCookie(properties: properties) { - self.set(cookie: cookie) - self.onUpdateCookieStorage?(self) + // set cookie + dispatchGroup.enter() + self.set(cookie: cookie) { + dispatchGroup.leave() + } } } } else { @@ -127,24 +136,62 @@ open class WKCookieWebView: WKWebView { if let cookie = HTTPCookie(properties: properties) { // set cookie - self.set(cookie: cookie) - self.onUpdateCookieStorage?(self) + dispatchGroup.enter() + self.set(cookie: cookie) { + dispatchGroup.leave() + } } } } } + + dispatchGroup.notify(queue: .main) { [weak self] in + self?.updateWKCookieToHTTPCookieStorage(cachedCookies) + + guard let self = self else { + return + } + + self.onUpdateCookieStorage?(self) + } } private func update(cookies: [HTTPCookie]?) { - cookies?.forEach { - set(cookie: $0) - + guard let cookies = cookies, cookies.isEmpty == false else { + return + } + + let dispatchGroup = DispatchGroup() + cookies.forEach { if !updatedCookies.contains($0.name) { updatedCookies.append($0.name) } + + dispatchGroup.enter() + set(cookie: $0) { + dispatchGroup.leave() + } + } + + dispatchGroup.notify(queue: .main) { [weak self] in + guard let self = self else { + return + } + + self.onUpdateCookieStorage?(self) + } + } + + private func updateWKCookieToHTTPCookieStorage(_ wkCookies: [HTTPCookie]?) { + guard let cookies = HTTPCookieStorage.shared.cookies, #available(iOS 11.0, *) else { + return } - onUpdateCookieStorage?(self) + wkCookies? + .filter { cookies.contains($0) == false } + .forEach { + HTTPCookieStorage.shared.setCookie($0) + } } } @@ -165,23 +212,27 @@ extension WKCookieWebView { func fetchCookies(fileter host: String, completion: @escaping HTTPCookieHandler) { fetchCookies { (cookies) in - completion(cookies?.filter { host.range(of: $0.domain) != nil }) + completion(cookies?.filter { host.range(of: $0.domain) != nil || $0.domain.range(of: host) != nil }) } } - func set(cookie: HTTPCookie) { + func set(cookie: HTTPCookie, completion: (() -> Void)? = nil) { HTTPCookieStorage.shared.setCookie(cookie) if #available(iOS 11.0, *) { - configuration.websiteDataStore.httpCookieStore.setCookie(cookie, completionHandler: nil) + configuration.websiteDataStore.httpCookieStore.setCookie(cookie, completionHandler: completion) + } else { + completion?() } } - func delete(cookie: HTTPCookie) { + func delete(cookie: HTTPCookie, completion: (() -> Void)? = nil) { HTTPCookieStorage.shared.deleteCookie(cookie) if #available(iOS 11.0, *) { - configuration.websiteDataStore.httpCookieStore.delete(cookie, completionHandler: nil) + configuration.websiteDataStore.httpCookieStore.delete(cookie, completionHandler: completion) + } else { + completion?() } } @@ -270,6 +321,20 @@ extension WKCookieWebView: WKNavigationDelegate { } // MARK: - HTTPCookie +extension HTTPCookie { + + open override func isEqual(_ object: Any?) -> Bool { + guard let other = object as? HTTPCookie else { + return false + } + + return name == other.name && + value == other.value && + domain == other.domain && + path == other.path + } + +} private extension HTTPCookie { From 53fd993ef78d7df99f8f5688e3a6d71c36541818 Mon Sep 17 00:00:00 2001 From: kofktu Date: Wed, 15 Jan 2020 14:35:21 +0900 Subject: [PATCH 3/7] Modify Example Project hierarchy --- Example/Example.xcodeproj/project.pbxproj | 127 ++-- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - Example/Example/ViewController.swift | 8 +- Example/Podfile | 9 - Example/Podfile.lock | 16 - .../WKCookieWebView.podspec.json | 24 - Example/Pods/Manifest.lock | 16 - Example/Pods/Pods.xcodeproj/project.pbxproj | 605 ------------------ .../Pods-Example/Info.plist | 26 - .../Pods-Example/Pods-Example-Info.plist | 26 - .../Pods-Example-acknowledgements.markdown | 28 - .../Pods-Example-acknowledgements.plist | 60 -- .../Pods-Example/Pods-Example-dummy.m | 5 - .../Pods-Example/Pods-Example-frameworks.sh | 163 ----- .../Pods-Example/Pods-Example-resources.sh | 118 ---- .../Pods-Example/Pods-Example-umbrella.h | 16 - .../Pods-Example/Pods-Example.debug.xcconfig | 11 - .../Pods-Example/Pods-Example.modulemap | 6 - .../Pods-Example.release.xcconfig | 11 - .../WKCookieWebView/Info.plist | 26 - .../WKCookieWebView-Info.plist | 26 - .../WKCookieWebView/WKCookieWebView-dummy.m | 5 - .../WKCookieWebView-prefix.pch | 12 - .../WKCookieWebView-umbrella.h | 16 - .../WKCookieWebView/WKCookieWebView.modulemap | 6 - .../WKCookieWebView/WKCookieWebView.xcconfig | 9 - WKCookieWebView.xcodeproj/project.pbxproj | 5 + .../xcschemes/WKCookieWebView.xcscheme | 4 - 29 files changed, 81 insertions(+), 1321 deletions(-) delete mode 100644 Example/Example.xcworkspace/contents.xcworkspacedata delete mode 100644 Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Example/Podfile delete mode 100644 Example/Podfile.lock delete mode 100644 Example/Pods/Local Podspecs/WKCookieWebView.podspec.json delete mode 100644 Example/Pods/Manifest.lock delete mode 100644 Example/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Info.plist delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example-Info.plist delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m delete mode 100755 Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh delete mode 100755 Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap delete mode 100644 Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/Info.plist delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-dummy.m delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-umbrella.h delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.modulemap delete mode 100644 Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.xcconfig diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 3c436fe..1da2c66 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 2B4BF5EFAEB365CCDD1C65F8 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0C5834909A3E455682DC898 /* Pods_Example.framework */; }; C337D68F1EFE2E1F00425943 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C337D68E1EFE2E1F00425943 /* AppDelegate.swift */; }; C337D6911EFE2E1F00425943 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C337D6901EFE2E1F00425943 /* ViewController.swift */; }; C337D6941EFE2E1F00425943 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C337D6921EFE2E1F00425943 /* Main.storyboard */; }; @@ -15,12 +14,43 @@ C337D6991EFE2E1F00425943 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C337D6971EFE2E1F00425943 /* LaunchScreen.storyboard */; }; C337D6B01EFE36D800425943 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C337D6AF1EFE36D800425943 /* Foundation.framework */; }; C337D6B21EFE36DD00425943 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C337D6B11EFE36DD00425943 /* UIKit.framework */; }; + CEE7871C23CED160007591F1 /* WKCookieWebView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEE7871923CED14B007591F1 /* WKCookieWebView.framework */; }; + CEE7871D23CED160007591F1 /* WKCookieWebView.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEE7871923CED14B007591F1 /* WKCookieWebView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; CEF44FDE220C061900101C21 /* ObjCWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CEF44FDD220C061900101C21 /* ObjCWebViewController.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + CEE7871823CED14B007591F1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEE7871423CED14B007591F1 /* WKCookieWebView.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C337D6771EFE2CFF00425943; + remoteInfo = WKCookieWebView; + }; + CEE7871A23CED155007591F1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CEE7871423CED14B007591F1 /* WKCookieWebView.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C337D6761EFE2CFF00425943; + remoteInfo = WKCookieWebView; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + CEE7871E23CED160007591F1 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + CEE7871D23CED160007591F1 /* WKCookieWebView.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - 153316C43EE6E51C0F6D10E5 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; - 4E916C9DB675D10B45CDAEDD /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; C337D68B1EFE2E1F00425943 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; C337D68E1EFE2E1F00425943 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C337D6901EFE2E1F00425943 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -30,6 +60,7 @@ C337D69A1EFE2E1F00425943 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C337D6AF1EFE36D800425943 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; C337D6B11EFE36DD00425943 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + CEE7871423CED14B007591F1 /* WKCookieWebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = WKCookieWebView.xcodeproj; path = ../WKCookieWebView.xcodeproj; sourceTree = ""; }; CEF44FDB220C061900101C21 /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Example-Bridging-Header.h"; sourceTree = ""; }; CEF44FDC220C061900101C21 /* ObjCWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjCWebViewController.h; sourceTree = ""; }; CEF44FDD220C061900101C21 /* ObjCWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ObjCWebViewController.m; sourceTree = ""; }; @@ -43,7 +74,7 @@ files = ( C337D6B21EFE36DD00425943 /* UIKit.framework in Frameworks */, C337D6B01EFE36D800425943 /* Foundation.framework in Frameworks */, - 2B4BF5EFAEB365CCDD1C65F8 /* Pods_Example.framework in Frameworks */, + CEE7871C23CED160007591F1 /* WKCookieWebView.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -53,8 +84,6 @@ 00A14BC87E2F7067567F18BE /* Pods */ = { isa = PBXGroup; children = ( - 4E916C9DB675D10B45CDAEDD /* Pods-Example.debug.xcconfig */, - 153316C43EE6E51C0F6D10E5 /* Pods-Example.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -62,6 +91,7 @@ C337D6821EFE2E1F00425943 = { isa = PBXGroup; children = ( + CEE7871423CED14B007591F1 /* WKCookieWebView.xcodeproj */, C337D68D1EFE2E1F00425943 /* Example */, C337D68C1EFE2E1F00425943 /* Products */, C337D6AE1EFE36D800425943 /* Frameworks */, @@ -103,6 +133,14 @@ name = Frameworks; sourceTree = ""; }; + CEE7871523CED14B007591F1 /* Products */ = { + isa = PBXGroup; + children = ( + CEE7871923CED14B007591F1 /* WKCookieWebView.framework */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -110,15 +148,15 @@ isa = PBXNativeTarget; buildConfigurationList = C337D69D1EFE2E1F00425943 /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( - 1246EA012691A75681E34C57 /* [CP] Check Pods Manifest.lock */, C337D6871EFE2E1F00425943 /* Sources */, C337D6881EFE2E1F00425943 /* Frameworks */, C337D6891EFE2E1F00425943 /* Resources */, - 957C72A292C0C742EDA5B5E9 /* [CP] Embed Pods Frameworks */, + CEE7871E23CED160007591F1 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + CEE7871B23CED155007591F1 /* PBXTargetDependency */, ); name = Example; productName = Example; @@ -155,6 +193,12 @@ mainGroup = C337D6821EFE2E1F00425943; productRefGroup = C337D68C1EFE2E1F00425943 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = CEE7871523CED14B007591F1 /* Products */; + ProjectRef = CEE7871423CED14B007591F1 /* WKCookieWebView.xcodeproj */; + }, + ); projectRoot = ""; targets = ( C337D68A1EFE2E1F00425943 /* Example */, @@ -162,6 +206,16 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + CEE7871923CED14B007591F1 /* WKCookieWebView.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = WKCookieWebView.framework; + remoteRef = CEE7871823CED14B007591F1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ C337D6891EFE2E1F00425943 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -175,53 +229,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 1246EA012691A75681E34C57 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 957C72A292C0C742EDA5B5E9 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/WKCookieWebView/WKCookieWebView.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WKCookieWebView.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ C337D6871EFE2E1F00425943 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -235,6 +242,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + CEE7871B23CED155007591F1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = WKCookieWebView; + targetProxy = CEE7871A23CED155007591F1 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ C337D6921EFE2E1F00425943 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -350,7 +365,6 @@ }; C337D69E1EFE2E1F00425943 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4E916C9DB675D10B45CDAEDD /* Pods-Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -367,7 +381,6 @@ }; C337D69F1EFE2E1F00425943 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 153316C43EE6E51C0F6D10E5 /* Pods-Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; diff --git a/Example/Example.xcworkspace/contents.xcworkspacedata b/Example/Example.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index a37cf19..0000000 --- a/Example/Example.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index e2871e3..ef59a5c 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -23,7 +23,7 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. - let urlString = "http://github.com" + let urlString = "https://m.cafe.naver.com/golmarket"//http://github.com" let isNeedPreloadForCookieSync = false if isNeedPreloadForCookieSync { @@ -39,6 +39,8 @@ class ViewController: UIViewController { setupWebView() webView.load(URLRequest(url: URL(string: urlString)!)) } + +// perform(#selector(printCookie), with: nil, afterDelay: 1.0) } // MARK: - Private @@ -71,12 +73,14 @@ class ViewController: UIViewController { } } - private func printCookie() { + @objc private func printCookie() { print("=====================Cookies=====================") HTTPCookieStorage.shared.cookies?.forEach { print($0) } print("=================================================") + +// perform(#selector(printCookie), with: nil, afterDelay: 1.0) } } diff --git a/Example/Podfile b/Example/Podfile deleted file mode 100644 index 126b379..0000000 --- a/Example/Podfile +++ /dev/null @@ -1,9 +0,0 @@ -# Uncomment the next line to define a global platform for your project -# platform :ios, '9.0' -use_frameworks! - -target 'Example' do - # Comment the next line if you're not using Swift and don't want to use dynamic frameworks - # Pods for Example - pod 'WKCookieWebView', :path => '../' -end diff --git a/Example/Podfile.lock b/Example/Podfile.lock deleted file mode 100644 index 911edb4..0000000 --- a/Example/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - WKCookieWebView (1.1.3) - -DEPENDENCIES: - - WKCookieWebView (from `../`) - -EXTERNAL SOURCES: - WKCookieWebView: - :path: "../" - -SPEC CHECKSUMS: - WKCookieWebView: 2967d53423348ea6c6be0462a21c3d1b26343162 - -PODFILE CHECKSUM: ba9274dcc56f1b604eac25e9bbe3dae4b04165f4 - -COCOAPODS: 1.6.1 diff --git a/Example/Pods/Local Podspecs/WKCookieWebView.podspec.json b/Example/Pods/Local Podspecs/WKCookieWebView.podspec.json deleted file mode 100644 index e864719..0000000 --- a/Example/Pods/Local Podspecs/WKCookieWebView.podspec.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "WKCookieWebView", - "version": "1.1.3", - "summary": "WKCookieWebView", - "description": "WKWebView with cookie sharing support", - "homepage": "https://github.com/Kofktu/WKCookieWebView", - "license": { - "type": "MIT", - "file": "LICENSE" - }, - "authors": { - "Kofktu": "kofktu@gmail.com" - }, - "platforms": { - "ios": "8.0" - }, - "source": { - "git": "https://github.com/Kofktu/WKCookieWebView.git", - "tag": "1.1.3" - }, - "source_files": "WKCookieWebView/**/*.{swift}", - "requires_arc": true, - "swift_version": "5.0" -} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock deleted file mode 100644 index 911edb4..0000000 --- a/Example/Pods/Manifest.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - WKCookieWebView (1.1.3) - -DEPENDENCIES: - - WKCookieWebView (from `../`) - -EXTERNAL SOURCES: - WKCookieWebView: - :path: "../" - -SPEC CHECKSUMS: - WKCookieWebView: 2967d53423348ea6c6be0462a21c3d1b26343162 - -PODFILE CHECKSUM: ba9274dcc56f1b604eac25e9bbe3dae4b04165f4 - -COCOAPODS: 1.6.1 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 5475ac4..0000000 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,605 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 0960C85B83FDB9F06FDD9E2455C862C3 /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 96575DA5A33E3BA4F12184BFE42BAD90 /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6338118D4369898916E74D1266DA1EED /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 76ACFBF7097B199449E8749F7EE01465 /* Pods-Example-dummy.m */; }; - 7806CE1B3D3BCB2DD80D3B1A3EEE8F6A /* WKCookieWebView-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F9B8D06FC63CACFC7009B84EFBE9078 /* WKCookieWebView-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9EF075A860AEA97D9FB1FCF8CB194CEF /* WKCookieWebViewPreloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7660A4838ECA422C9F31CA74CEAD6A1A /* WKCookieWebViewPreloader.swift */; }; - B214DF1BB766D11009045B9556B1D6C8 /* WKCookieWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6347E05729CDDE494D0F26D373369F70 /* WKCookieWebView.swift */; }; - D4B41CA616F5EDD5B8053831167A82CF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; - DEA14AEAAF6B55356B1B67E0E9F6B331 /* WKCookieWebView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E589899935AEEC399B40D294D057D326 /* WKCookieWebView-dummy.m */; }; - E6F01327FD0B71BEA5892DCB8D16266F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - B22E142646A43BBACF021DBE3CDABEEB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 5C8CFCF7BDB893EFF9C0F73798CBD9CC; - remoteInfo = WKCookieWebView; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0D7670157C7D120B0D5E584600E00029 /* Pods-Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-Info.plist"; sourceTree = ""; }; - 13690F8BEA03FF5236FE44FDC7B6EAAD /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; - 19D1D549A499E58347163FE7AF879571 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Example.framework; path = "Pods-Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2C162FC21D423A87FC143A0B632CFC08 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = ""; }; - 2F9B8D06FC63CACFC7009B84EFBE9078 /* WKCookieWebView-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WKCookieWebView-umbrella.h"; sourceTree = ""; }; - 35E2C288A180219D12F161F8F67849E8 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; - 38E2D0FC5B795552B0998ADC2C52D789 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; - 4068C6FC16B695F1B8A5611E77893DC9 /* WKCookieWebView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "WKCookieWebView-prefix.pch"; sourceTree = ""; }; - 415F61F11BD564043CA80AC49145E3C2 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; - 55D3ADE233900B5C67CEBDDED9DCECCC /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; - 6347E05729CDDE494D0F26D373369F70 /* WKCookieWebView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WKCookieWebView.swift; path = WKCookieWebView/WKCookieWebView.swift; sourceTree = ""; }; - 64CA1279428C6FFCCB314759C221C29B /* WKCookieWebView.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = WKCookieWebView.modulemap; sourceTree = ""; }; - 7660A4838ECA422C9F31CA74CEAD6A1A /* WKCookieWebViewPreloader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WKCookieWebViewPreloader.swift; path = WKCookieWebView/WKCookieWebViewPreloader.swift; sourceTree = ""; }; - 76ACFBF7097B199449E8749F7EE01465 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; - 96575DA5A33E3BA4F12184BFE42BAD90 /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - ADD0587B37B52C1E8ECBBA43CF7761CB /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; - BE3BA84255020A58AEAC14FA92B8B0E5 /* WKCookieWebView-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "WKCookieWebView-Info.plist"; sourceTree = ""; }; - C533D235E73966E3ECB5124AC5A7B23B /* WKCookieWebView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = WKCookieWebView.framework; path = WKCookieWebView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C743D3A5AB93A727EA1A577CE93AF024 /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Example.modulemap"; sourceTree = ""; }; - CABC444B46702E4B081E5AD1E39542B8 /* WKCookieWebView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = WKCookieWebView.xcconfig; sourceTree = ""; }; - CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - CD3442EDB5A447FADE6DFB47F7E4D406 /* WKCookieWebView.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = WKCookieWebView.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - E589899935AEEC399B40D294D057D326 /* WKCookieWebView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "WKCookieWebView-dummy.m"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A03392EA0E0C3A574CD84CAEA7985110 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D4B41CA616F5EDD5B8053831167A82CF /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E2C4424F733384BA4F2987D37AC606E3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E6F01327FD0B71BEA5892DCB8D16266F /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 5B2E29C865B6B15F964BB82D3C915AB7 /* Development Pods */ = { - isa = PBXGroup; - children = ( - DF0E06E1A562139F5AD6A6944BB014D1 /* WKCookieWebView */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 9B055D0CFEA43187E72B03DED11F5662 /* iOS */ = { - isa = PBXGroup; - children = ( - CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - BBDD15EA87B1F1294BC5D887D4DEB249 /* Support Files */ = { - isa = PBXGroup; - children = ( - 64CA1279428C6FFCCB314759C221C29B /* WKCookieWebView.modulemap */, - CABC444B46702E4B081E5AD1E39542B8 /* WKCookieWebView.xcconfig */, - E589899935AEEC399B40D294D057D326 /* WKCookieWebView-dummy.m */, - BE3BA84255020A58AEAC14FA92B8B0E5 /* WKCookieWebView-Info.plist */, - 4068C6FC16B695F1B8A5611E77893DC9 /* WKCookieWebView-prefix.pch */, - 2F9B8D06FC63CACFC7009B84EFBE9078 /* WKCookieWebView-umbrella.h */, - ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/WKCookieWebView"; - sourceTree = ""; - }; - CE2E825F08D3AD0FD76E6D78D7512ED0 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - F9A708936E99FD7F473C57BA21F7279D /* Pods-Example */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - CF1408CF629C7361332E53B88F7BD30C = { - isa = PBXGroup; - children = ( - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, - 5B2E29C865B6B15F964BB82D3C915AB7 /* Development Pods */, - D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, - F13EBB31F7DA582A97B55ECD4FBFFFE8 /* Products */, - CE2E825F08D3AD0FD76E6D78D7512ED0 /* Targets Support Files */, - ); - sourceTree = ""; - }; - D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 9B055D0CFEA43187E72B03DED11F5662 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - DF0E06E1A562139F5AD6A6944BB014D1 /* WKCookieWebView */ = { - isa = PBXGroup; - children = ( - 6347E05729CDDE494D0F26D373369F70 /* WKCookieWebView.swift */, - 7660A4838ECA422C9F31CA74CEAD6A1A /* WKCookieWebViewPreloader.swift */, - E9AD24E660BB58B8BFCCFEA25F765003 /* Pod */, - BBDD15EA87B1F1294BC5D887D4DEB249 /* Support Files */, - ); - name = WKCookieWebView; - path = ../..; - sourceTree = ""; - }; - E9AD24E660BB58B8BFCCFEA25F765003 /* Pod */ = { - isa = PBXGroup; - children = ( - 38E2D0FC5B795552B0998ADC2C52D789 /* LICENSE */, - 13690F8BEA03FF5236FE44FDC7B6EAAD /* README.md */, - CD3442EDB5A447FADE6DFB47F7E4D406 /* WKCookieWebView.podspec */, - ); - name = Pod; - sourceTree = ""; - }; - F13EBB31F7DA582A97B55ECD4FBFFFE8 /* Products */ = { - isa = PBXGroup; - children = ( - 19D1D549A499E58347163FE7AF879571 /* Pods_Example.framework */, - C533D235E73966E3ECB5124AC5A7B23B /* WKCookieWebView.framework */, - ); - name = Products; - sourceTree = ""; - }; - F9A708936E99FD7F473C57BA21F7279D /* Pods-Example */ = { - isa = PBXGroup; - children = ( - C743D3A5AB93A727EA1A577CE93AF024 /* Pods-Example.modulemap */, - ADD0587B37B52C1E8ECBBA43CF7761CB /* Pods-Example-acknowledgements.markdown */, - 55D3ADE233900B5C67CEBDDED9DCECCC /* Pods-Example-acknowledgements.plist */, - 76ACFBF7097B199449E8749F7EE01465 /* Pods-Example-dummy.m */, - 2C162FC21D423A87FC143A0B632CFC08 /* Pods-Example-frameworks.sh */, - 0D7670157C7D120B0D5E584600E00029 /* Pods-Example-Info.plist */, - 96575DA5A33E3BA4F12184BFE42BAD90 /* Pods-Example-umbrella.h */, - 35E2C288A180219D12F161F8F67849E8 /* Pods-Example.debug.xcconfig */, - 415F61F11BD564043CA80AC49145E3C2 /* Pods-Example.release.xcconfig */, - ); - name = "Pods-Example"; - path = "Target Support Files/Pods-Example"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 9F8F95E218B49DE515912E0D93EBAA73 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7806CE1B3D3BCB2DD80D3B1A3EEE8F6A /* WKCookieWebView-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - E9CF130400B805BB7A49C1EAFC03F379 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 0960C85B83FDB9F06FDD9E2455C862C3 /* Pods-Example-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 5C8CFCF7BDB893EFF9C0F73798CBD9CC /* WKCookieWebView */ = { - isa = PBXNativeTarget; - buildConfigurationList = C8BD373C50186980DBBC7160ED9C8FAD /* Build configuration list for PBXNativeTarget "WKCookieWebView" */; - buildPhases = ( - 9F8F95E218B49DE515912E0D93EBAA73 /* Headers */, - 9632A9B58A3E8E2ECA154D0EED1C8F92 /* Sources */, - E2C4424F733384BA4F2987D37AC606E3 /* Frameworks */, - F55A88BCC79CF89FFC58799EC5B35670 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = WKCookieWebView; - productName = WKCookieWebView; - productReference = C533D235E73966E3ECB5124AC5A7B23B /* WKCookieWebView.framework */; - productType = "com.apple.product-type.framework"; - }; - AB3281AB36BBA2D6A4B41F6C5C2770F9 /* Pods-Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = C378C550854DF9110D111605F4EF017E /* Build configuration list for PBXNativeTarget "Pods-Example" */; - buildPhases = ( - E9CF130400B805BB7A49C1EAFC03F379 /* Headers */, - F7DF2F7BFBDD5DFB7E152668FB71E49E /* Sources */, - A03392EA0E0C3A574CD84CAEA7985110 /* Frameworks */, - B5C4C281F0AAE685F69185FB835482AE /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - B466245F4D89D6CF05E6F03407648E2A /* PBXTargetDependency */, - ); - name = "Pods-Example"; - productName = "Pods-Example"; - productReference = 19D1D549A499E58347163FE7AF879571 /* Pods_Example.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - BFDFE7DC352907FC980B868725387E98 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - }; - buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = CF1408CF629C7361332E53B88F7BD30C; - productRefGroup = F13EBB31F7DA582A97B55ECD4FBFFFE8 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - AB3281AB36BBA2D6A4B41F6C5C2770F9 /* Pods-Example */, - 5C8CFCF7BDB893EFF9C0F73798CBD9CC /* WKCookieWebView */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - B5C4C281F0AAE685F69185FB835482AE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F55A88BCC79CF89FFC58799EC5B35670 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 9632A9B58A3E8E2ECA154D0EED1C8F92 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DEA14AEAAF6B55356B1B67E0E9F6B331 /* WKCookieWebView-dummy.m in Sources */, - B214DF1BB766D11009045B9556B1D6C8 /* WKCookieWebView.swift in Sources */, - 9EF075A860AEA97D9FB1FCF8CB194CEF /* WKCookieWebViewPreloader.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7DF2F7BFBDD5DFB7E152668FB71E49E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6338118D4369898916E74D1266DA1EED /* Pods-Example-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - B466245F4D89D6CF05E6F03407648E2A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = WKCookieWebView; - target = 5C8CFCF7BDB893EFF9C0F73798CBD9CC /* WKCookieWebView */; - targetProxy = B22E142646A43BBACF021DBE3CDABEEB /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 159B08C6EBCF6F3E0761A301E8D60517 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 415F61F11BD564043CA80AC49145E3C2 /* Pods-Example.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-Example/Pods-Example-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 16FD0648F06E4A022961C9516E16703A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.2; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - 2DB13D3FAE987D20610ACD677A28C6E8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 5E01923BC12B360A93811611B3FCCBB3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 35E2C288A180219D12F161F8F67849E8 /* Pods-Example.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-Example/Pods-Example-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 6448DAB02D9F9BA41BD264FBAE2A9290 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CABC444B46702E4B081E5AD1E39542B8 /* WKCookieWebView.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/WKCookieWebView/WKCookieWebView.modulemap"; - PRODUCT_MODULE_NAME = WKCookieWebView; - PRODUCT_NAME = WKCookieWebView; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - F9703CA76482E424E720C4AF704D054E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CABC444B46702E4B081E5AD1E39542B8 /* WKCookieWebView.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/WKCookieWebView/WKCookieWebView.modulemap"; - PRODUCT_MODULE_NAME = WKCookieWebView; - PRODUCT_NAME = WKCookieWebView; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2DB13D3FAE987D20610ACD677A28C6E8 /* Debug */, - 16FD0648F06E4A022961C9516E16703A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C378C550854DF9110D111605F4EF017E /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5E01923BC12B360A93811611B3FCCBB3 /* Debug */, - 159B08C6EBCF6F3E0761A301E8D60517 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C8BD373C50186980DBBC7160ED9C8FAD /* Build configuration list for PBXNativeTarget "WKCookieWebView" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F9703CA76482E424E720C4AF704D054E /* Debug */, - 6448DAB02D9F9BA41BD264FBAE2A9290 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; -} diff --git a/Example/Pods/Target Support Files/Pods-Example/Info.plist b/Example/Pods/Target Support Files/Pods-Example/Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-Info.plist b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-Info.plist deleted file mode 100644 index 2243fe6..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown deleted file mode 100644 index 8892efe..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown +++ /dev/null @@ -1,28 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## WKCookieWebView - -MIT License - -Copyright (c) 2017 Taeun Kim - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist deleted file mode 100644 index b743fd1..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - MIT License - -Copyright (c) 2017 Taeun Kim - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - License - MIT - Title - WKCookieWebView - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m deleted file mode 100644 index 6ee3f90..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_Example : NSObject -@end -@implementation PodsDummy_Pods_Example -@end diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh deleted file mode 100755 index 8f8df4a..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -function on_error { - echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" -} -trap 'on_error $LINENO' ERR - -if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then - # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy - # frameworks to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -# Used as a return value for each invocation of `strip_invalid_archs` function. -STRIP_BINARY_RETVAL=0 - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -# Copies and strips a vendored framework -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # Use filter instead of exclude so missing patterns don't throw errors. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - elif [ -L "${binary}" ]; then - echo "Destination binary is symlinked..." - dirname="$(dirname "${binary}")" - binary="${dirname}/$(readlink "${binary}")" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Copies and strips a vendored dSYM -install_dsym() { - local source="$1" - if [ -r "$source" ]; then - # Copy the dSYM into a the targets temp dir. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" - - local basename - basename="$(basename -s .framework.dSYM "$source")" - binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then - strip_invalid_archs "$binary" - fi - - if [[ $STRIP_BINARY_RETVAL == 1 ]]; then - # Move the stripped file into its final destination. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" - else - # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. - touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" - fi - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identity - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" - - if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - code_sign_cmd="$code_sign_cmd &" - fi - echo "$code_sign_cmd" - eval "$code_sign_cmd" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current target binary - binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" - # Intersect them with the architectures we are building for - intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" - # If there are no archs supported by this binary then warn the user - if [[ -z "$intersected_archs" ]]; then - echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." - STRIP_BINARY_RETVAL=0 - return - fi - stripped="" - for arch in $binary_archs; do - if ! [[ "${ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi - STRIP_BINARY_RETVAL=1 -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/WKCookieWebView/WKCookieWebView.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/WKCookieWebView/WKCookieWebView.framework" -fi -if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - wait -fi diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh deleted file mode 100755 index 345301f..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then - # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy - # resources to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -case "${TARGETED_DEVICE_FAMILY:-}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - 3) - TARGET_DEVICE_ARGS="--target-device tv" - ;; - 4) - TARGET_DEVICE_ARGS="--target-device watch" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" || true - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - else - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" - fi -fi diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h b/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h deleted file mode 100644 index ecf498e..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double Pods_ExampleVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig deleted file mode 100644 index 6cac35a..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKCookieWebView" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKCookieWebView/WKCookieWebView.framework/Headers" -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_LDFLAGS = $(inherited) -framework "WKCookieWebView" -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap deleted file mode 100644 index 4b5189f..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_Example { - umbrella header "Pods-Example-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig deleted file mode 100644 index 6cac35a..0000000 --- a/Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKCookieWebView" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/WKCookieWebView/WKCookieWebView.framework/Headers" -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_LDFLAGS = $(inherited) -framework "WKCookieWebView" -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/WKCookieWebView/Info.plist b/Example/Pods/Target Support Files/WKCookieWebView/Info.plist deleted file mode 100644 index a97078a..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.1.3 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist deleted file mode 100644 index e2b682b..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 2.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-dummy.m b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-dummy.m deleted file mode 100644 index 1a98531..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_WKCookieWebView : NSObject -@end -@implementation PodsDummy_WKCookieWebView -@end diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch deleted file mode 100644 index beb2a24..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-prefix.pch +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-umbrella.h b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-umbrella.h deleted file mode 100644 index fffe3aa..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView-umbrella.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - - -FOUNDATION_EXPORT double WKCookieWebViewVersionNumber; -FOUNDATION_EXPORT const unsigned char WKCookieWebViewVersionString[]; - diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.modulemap b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.modulemap deleted file mode 100644 index cbd0e9d..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module WKCookieWebView { - umbrella header "WKCookieWebView-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.xcconfig b/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.xcconfig deleted file mode 100644 index 8e8ee84..0000000 --- a/Example/Pods/Target Support Files/WKCookieWebView/WKCookieWebView.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/WKCookieWebView -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/WKCookieWebView.xcodeproj/project.pbxproj b/WKCookieWebView.xcodeproj/project.pbxproj index 433253d..8b098e1 100644 --- a/WKCookieWebView.xcodeproj/project.pbxproj +++ b/WKCookieWebView.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ C337D67C1EFE2CFF00425943 /* WKCookieWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = C337D67A1EFE2CFF00425943 /* WKCookieWebView.h */; settings = {ATTRIBUTES = (Public, ); }; }; C369A63F1EFE46ED008CB0BE /* WKCookieWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C369A63E1EFE46E8008CB0BE /* WKCookieWebView.swift */; }; + CEE7871323CECF9B007591F1 /* WKCookieWebViewPreloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEE7871223CECF9A007591F1 /* WKCookieWebViewPreloader.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -16,6 +17,7 @@ C337D67A1EFE2CFF00425943 /* WKCookieWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKCookieWebView.h; sourceTree = ""; }; C337D67B1EFE2CFF00425943 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C369A63E1EFE46E8008CB0BE /* WKCookieWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKCookieWebView.swift; sourceTree = ""; }; + CEE7871223CECF9A007591F1 /* WKCookieWebViewPreloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKCookieWebViewPreloader.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -50,6 +52,7 @@ children = ( C337D67A1EFE2CFF00425943 /* WKCookieWebView.h */, C369A63E1EFE46E8008CB0BE /* WKCookieWebView.swift */, + CEE7871223CECF9A007591F1 /* WKCookieWebViewPreloader.swift */, C337D67B1EFE2CFF00425943 /* Info.plist */, ); path = WKCookieWebView; @@ -108,6 +111,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = C337D66D1EFE2CFF00425943; @@ -135,6 +139,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CEE7871323CECF9B007591F1 /* WKCookieWebViewPreloader.swift in Sources */, C369A63F1EFE46ED008CB0BE /* WKCookieWebView.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/WKCookieWebView.xcodeproj/xcshareddata/xcschemes/WKCookieWebView.xcscheme b/WKCookieWebView.xcodeproj/xcshareddata/xcschemes/WKCookieWebView.xcscheme index 98f1f7c..3410137 100644 --- a/WKCookieWebView.xcodeproj/xcshareddata/xcschemes/WKCookieWebView.xcscheme +++ b/WKCookieWebView.xcodeproj/xcshareddata/xcschemes/WKCookieWebView.xcscheme @@ -29,8 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - Date: Wed, 15 Jan 2020 14:36:06 +0900 Subject: [PATCH 4/7] Modify Example webView url --- Example/Example/ViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index ef59a5c..95f8e6c 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -23,7 +23,7 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. - let urlString = "https://m.cafe.naver.com/golmarket"//http://github.com" + let urlString = "http://github.com" let isNeedPreloadForCookieSync = false if isNeedPreloadForCookieSync { From 9691ae283db872422f65f99377996e9368ea2c8c Mon Sep 17 00:00:00 2001 From: Taeun Kim Date: Mon, 30 Mar 2020 12:53:22 +0900 Subject: [PATCH 5/7] Feature/modify sync cookiestore and storage (#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HTTPCookieStore 와 HTTPCookieStorage 싱크방법 변경 --- Example/Example/ViewController.swift | 8 +- WKCookieWebView/WKCookieWebView.swift | 142 +++++++------------------- 2 files changed, 40 insertions(+), 110 deletions(-) diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index 95f8e6c..885c5a6 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -74,13 +74,15 @@ class ViewController: UIViewController { } @objc private func printCookie() { + guard let url = webView.url else { + return + } + print("=====================Cookies=====================") - HTTPCookieStorage.shared.cookies?.forEach { + HTTPCookieStorage.shared.cookies(for: url)?.forEach { print($0) } print("=================================================") - -// perform(#selector(printCookie), with: nil, afterDelay: 1.0) } } diff --git a/WKCookieWebView/WKCookieWebView.swift b/WKCookieWebView/WKCookieWebView.swift index 1942732..a9b3f67 100644 --- a/WKCookieWebView/WKCookieWebView.swift +++ b/WKCookieWebView/WKCookieWebView.swift @@ -10,7 +10,7 @@ import UIKit import Foundation import WebKit -fileprivate class WKCookieProcessPool: WKProcessPool { +fileprivate final class WKCookieProcessPool: WKProcessPool { static let pool = WKCookieProcessPool() } @@ -36,7 +36,6 @@ open class WKCookieWebView: WKWebView { configuration.processPool = WKCookieProcessPool.pool configurationBlock?(configuration) super.init(frame: frame, configuration: configuration) - configuration.userContentController = userContentWithCookies() navigationDelegate = self } @@ -44,11 +43,18 @@ open class WKCookieWebView: WKWebView { fatalError("init(coder:) has not been implemented, init(frame:configurationBlock:)") } + open override func load(_ request: URLRequest) -> WKNavigation? { + request.url.flatMap { + configuration.userContentController = userContentWithCookies($0) + } + return super.load(request) + } + // MARK: - Private - private func userContentWithCookies() -> WKUserContentController { + private func userContentWithCookies(_ url: URL) -> WKUserContentController { let userContentController = configuration.userContentController - if let cookies = HTTPCookieStorage.shared.cookies, cookies.count > 0 { + if let cookies = HTTPCookieStorage.shared.cookies(for: url), cookies.count > 0 { // https://stackoverflow.com/a/32845148 var scripts: [String] = ["var cookieNames = document.cookie.split('; ').map(function(cookie) { return cookie.split('=')[0] } )"] @@ -73,86 +79,26 @@ open class WKCookieWebView: WKWebView { return userContentController } - private func update(webView: WKWebView) { + private func updateHigherOS11(webView: WKWebView) { // WKWebView -> HTTPCookieStorage - webView.evaluateJavaScript("document.cookie;") { [weak self] (result, error) in - guard let host = self?.url?.host, - let documentCookie = result as? String else { - return - } - - self?.fetchCookies(fileter: host, completion: { [weak self] (cookies) in - self?.update(with: cookies, documentCookie: documentCookie, host: host) - }) + guard #available(iOS 11.0, *) else { + return } - } - - private func update(with cachedCookies: [HTTPCookie]?, documentCookie: String, host: String) { - let cookieValues = documentCookie.components(separatedBy: "; ") - - guard cookieValues.isEmpty == false else { + + guard let url = url, let host = url.host else { return } - - let dispatchGroup = DispatchGroup() - - for value in cookieValues { - var comps = value.components(separatedBy: "=") - if comps.count < 2 { continue } - - let cookieName = comps.removeFirst() - let cookieValue = comps.joined(separator: "=") - let localCookie = cachedCookies?.filter { $0.name == cookieName }.first - - if let localCookie = localCookie { - if !cookieValue.isEmpty && localCookie.value != cookieValue { - // set/update cookie - var properties: [HTTPCookiePropertyKey: Any] = localCookie.properties ?? [ - .name: localCookie.name, - .domain: localCookie.domain, - .path: localCookie.path - ] - - properties[.value] = cookieValue - - self.delete(cookie: localCookie) - - if let cookie = HTTPCookie(properties: properties) { - // set cookie - dispatchGroup.enter() - self.set(cookie: cookie) { - dispatchGroup.leave() - } - } - } - } else { - if !cookieName.isEmpty && !cookieValue.isEmpty { - let properties: [HTTPCookiePropertyKey: Any] = [ - .name: cookieName, - .value: cookieValue, - .domain: host, - .path: "/" - ] - - if let cookie = HTTPCookie(properties: properties) { - // set cookie - dispatchGroup.enter() - self.set(cookie: cookie) { - dispatchGroup.leave() - } - } - } - } + + HTTPCookieStorage.shared.cookies(for: url)?.forEach { + HTTPCookieStorage.shared.deleteCookie($0) } - dispatchGroup.notify(queue: .main) { [weak self] in - self?.updateWKCookieToHTTPCookieStorage(cachedCookies) + configuration.websiteDataStore.httpCookieStore.getAllCookies { [weak self] (cookies) in + cookies + .filter { host.range(of: $0.domain) != nil || $0.domain.range(of: host) != nil } + .forEach { HTTPCookieStorage.shared.setCookie($0) } - guard let self = self else { - return - } - - self.onUpdateCookieStorage?(self) + self.flatMap { $0.onUpdateCookieStorage?($0) } } } @@ -182,42 +128,14 @@ open class WKCookieWebView: WKWebView { } } - private func updateWKCookieToHTTPCookieStorage(_ wkCookies: [HTTPCookie]?) { - guard let cookies = HTTPCookieStorage.shared.cookies, #available(iOS 11.0, *) else { - return - } - - wkCookies? - .filter { cookies.contains($0) == false } - .forEach { - HTTPCookieStorage.shared.setCookie($0) - } - } - } extension WKCookieWebView { typealias HTTPCookieHandler = ([HTTPCookie]?) -> Void - func fetchCookies(completion: @escaping HTTPCookieHandler) { - if #available(iOS 11.0, *) { - configuration.websiteDataStore.httpCookieStore.getAllCookies { (cookies) in - completion(cookies) - } - } else { - completion(HTTPCookieStorage.shared.cookies) - } - } - - func fetchCookies(fileter host: String, completion: @escaping HTTPCookieHandler) { - fetchCookies { (cookies) in - completion(cookies?.filter { host.range(of: $0.domain) != nil || $0.domain.range(of: host) != nil }) - } - } - func set(cookie: HTTPCookie, completion: (() -> Void)? = nil) { - HTTPCookieStorage.shared.setCookie(cookie) + set(httpCookieStorage: cookie) if #available(iOS 11.0, *) { configuration.websiteDataStore.httpCookieStore.setCookie(cookie, completionHandler: completion) @@ -226,6 +144,10 @@ extension WKCookieWebView { } } + func set(httpCookieStorage cookie: HTTPCookie) { + HTTPCookieStorage.shared.setCookie(cookie) + } + func delete(cookie: HTTPCookie, completion: (() -> Void)? = nil) { HTTPCookieStorage.shared.deleteCookie(cookie) @@ -281,7 +203,7 @@ extension WKCookieWebView: WKNavigationDelegate { } public func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { - update(webView: webView) + updateHigherOS11(webView: webView) wkNavigationDelegate?.webView?(webView, didCommit: navigation) } @@ -339,6 +261,12 @@ extension HTTPCookie { private extension HTTPCookie { var javaScriptString: String { + if let values = (self.properties? + .map { "\($0.key.rawValue)=\($0.value)" } + .joined(separator: "; ")) { + return values + } + var properties = [ "\(name)=\(value)", "domain=\(domain)", From 2eb629839b8c0d755ee91b2cfe14456076c43e86 Mon Sep 17 00:00:00 2001 From: Taeun Kim Date: Mon, 30 Mar 2020 13:17:36 +0900 Subject: [PATCH 6/7] Remove Handler Properties (#12) Support Delegate function --- .travis.yml | 4 +- Example/Example/ObjCWebViewController.m | 6 +- Example/Example/ViewController.swift | 20 +++---- WKCookieWebView/WKCookieWebView.swift | 73 ++++++++++++++++--------- 4 files changed, 59 insertions(+), 44 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51d34e8..17eb815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ os: osx -osx_image: xcode10 +osx_image: xcode11 sudo: false language: objective-c env: - - SDK="iphoneos12.0" + - SDK="iphoneos13.0" script: - xcodebuild clean build -sdk $SDK -configuration Debug CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO diff --git a/Example/Example/ObjCWebViewController.m b/Example/Example/ObjCWebViewController.m index a16e350..9eb3199 100644 --- a/Example/Example/ObjCWebViewController.m +++ b/Example/Example/ObjCWebViewController.m @@ -32,11 +32,7 @@ - (void)setupWebView { self.webView = [[WKCookieWebView alloc] initWithFrame:CGRectZero configurationBlock:^(WKWebViewConfiguration * _Nonnull configuration) { }]; - [self.webView setOnDecidePolicyForNavigationAction:^(WKWebView * _Nonnull webView, - WKNavigationAction * _Nonnull navigationAction, - void (^ _Nonnull decisionHandler)(WKNavigationActionPolicy)) { - decisionHandler(WKNavigationActionPolicyAllow); - }]; + [self.webView setOnUpdateCookieStorage:^(WKCookieWebView * _Nonnull webView) { }]; diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift index 885c5a6..b43d9cc 100644 --- a/Example/Example/ViewController.swift +++ b/Example/Example/ViewController.swift @@ -39,8 +39,6 @@ class ViewController: UIViewController { setupWebView() webView.load(URLRequest(url: URL(string: urlString)!)) } - -// perform(#selector(printCookie), with: nil, afterDelay: 1.0) } // MARK: - Private @@ -60,14 +58,6 @@ class ViewController: UIViewController { metrics: nil, views: views)) - webView.onDecidePolicyForNavigationAction = { (webView, navigationAction, decisionHandler) in - decisionHandler(.allow) - } - - webView.onDecidePolicyForNavigationResponse = { (webView, navigationResponse, decisionHandler) in - decisionHandler(.allow) - } - webView.onUpdateCookieStorage = { [weak self] (webView) in self?.printCookie() } @@ -88,6 +78,16 @@ class ViewController: UIViewController { extension ViewController: WKNavigationDelegate { + func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { + print("ViewController.decidePolicyFor.Action") + decisionHandler(.allow) + } + + func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { + print("ViewController.decidePolicyFor.Response") + decisionHandler(.allow) + } + func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { print("didFail.error : \(error)") } diff --git a/WKCookieWebView/WKCookieWebView.swift b/WKCookieWebView/WKCookieWebView.swift index a9b3f67..d7a910d 100644 --- a/WKCookieWebView/WKCookieWebView.swift +++ b/WKCookieWebView/WKCookieWebView.swift @@ -16,14 +16,20 @@ fileprivate final class WKCookieProcessPool: WKProcessPool { open class WKCookieWebView: WKWebView { + open override var navigationDelegate: WKNavigationDelegate? { + didSet { + guard navigationDelegate?.isEqual(self) == false else { + return + } + + wkNavigationDelegate = navigationDelegate + navigationDelegate = self + } + } + // Must use this instead of navigationDelegate @objc public weak var wkNavigationDelegate: WKNavigationDelegate? - // If necessary, use clousre instead of delegate - @objc public var onDecidePolicyForNavigationAction: ((WKWebView, WKNavigationAction, @escaping (WKNavigationActionPolicy) -> Swift.Void) -> Void)? - @objc public var onDecidePolicyForNavigationResponse: ((WKWebView, WKNavigationResponse, @escaping (WKNavigationResponsePolicy) -> Swift.Void) -> Void)? - @objc public var onDidReceiveChallenge: ((WKWebView, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.Void) -> Void)? - // The closure where cookie information is called at update time @objc public var onUpdateCookieStorage: ((WKCookieWebView) -> Void)? @@ -43,10 +49,12 @@ open class WKCookieWebView: WKWebView { fatalError("init(coder:) has not been implemented, init(frame:configurationBlock:)") } + @discardableResult open override func load(_ request: URLRequest) -> WKNavigation? { request.url.flatMap { configuration.userContentController = userContentWithCookies($0) } + return super.load(request) } @@ -165,17 +173,28 @@ extension WKCookieWebView: WKNavigationDelegate { // MARK: - WKNavigationDelegate public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) { - if let handler = onDecidePolicyForNavigationAction { - handler(webView, navigationAction, decisionHandler) - } else { - decisionHandler(.allow) + guard (wkNavigationDelegate?.webView?(webView, decidePolicyFor: navigationAction, decisionHandler: decisionHandler)) == nil else { + return + } + + decisionHandler(.allow) + } + + @available(iOS 13.0, *) + public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, preferences: WKWebpagePreferences, decisionHandler: @escaping (WKNavigationActionPolicy, WKWebpagePreferences) -> Void) { + guard (wkNavigationDelegate?.webView?(webView, decidePolicyFor: navigationAction, preferences: preferences, decisionHandler: decisionHandler)) == nil else { + return + } + + self.webView(webView, decidePolicyFor: navigationAction) { (policy) in + decisionHandler(policy, preferences) } } - public func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Swift.Void) { + public func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> + Swift.Void) { defer { - if let handler = onDecidePolicyForNavigationResponse { - handler(webView, navigationResponse, decisionHandler) + if (wkNavigationDelegate?.webView?(webView, decidePolicyFor: navigationResponse, decisionHandler: decisionHandler)) != nil { } else { decisionHandler(.allow) } @@ -216,23 +235,23 @@ extension WKCookieWebView: WKNavigationDelegate { } public func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Swift.Void) { - if let handler = onDidReceiveChallenge { - handler(webView, challenge, completionHandler) - } else { - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - if let serverTrust = challenge.protectionSpace.serverTrust { - credential = URLCredential(trust: serverTrust) - disposition = .useCredential - } - } else { - disposition = .cancelAuthenticationChallenge + guard (wkNavigationDelegate?.webView?(webView, didReceive: challenge, completionHandler: completionHandler)) == nil else { + return + } + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + if let serverTrust = challenge.protectionSpace.serverTrust { + credential = URLCredential(trust: serverTrust) + disposition = .useCredential } - - completionHandler(disposition, credential) + } else { + disposition = .cancelAuthenticationChallenge } + + completionHandler(disposition, credential) } @available(iOS 9.0, *) From dd5a1757f22c0a1d70a5f707a9829cc092f8533f Mon Sep 17 00:00:00 2001 From: Kofktu Date: Mon, 30 Mar 2020 13:19:23 +0900 Subject: [PATCH 7/7] 2.0.2 Release --- README.md | 23 ----------------------- WKCookieWebView.podspec | 2 +- WKCookieWebView.xcodeproj/project.pbxproj | 2 ++ WKCookieWebView/Info.plist | 2 +- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 175a8bc..dd7e14e 100644 --- a/README.md +++ b/README.md @@ -28,29 +28,6 @@ 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 diff --git a/WKCookieWebView.podspec b/WKCookieWebView.podspec index cb406c1..9bac045 100644 --- a/WKCookieWebView.podspec +++ b/WKCookieWebView.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "WKCookieWebView" - s.version = "2.0.1" + s.version = "2.0.2" s.summary = "WKCookieWebView" # This description is used to generate tags and improve search results. diff --git a/WKCookieWebView.xcodeproj/project.pbxproj b/WKCookieWebView.xcodeproj/project.pbxproj index 8b098e1..b031528 100644 --- a/WKCookieWebView.xcodeproj/project.pbxproj +++ b/WKCookieWebView.xcodeproj/project.pbxproj @@ -263,6 +263,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.2; PRODUCT_BUNDLE_IDENTIFIER = com.kofktu.WKCookieWebView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -284,6 +285,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.2; PRODUCT_BUNDLE_IDENTIFIER = com.kofktu.WKCookieWebView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/WKCookieWebView/Info.plist b/WKCookieWebView/Info.plist index 0e27f5f..ec0cc7b 100644 --- a/WKCookieWebView/Info.plist +++ b/WKCookieWebView/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.0.1 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass