Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- WKBridge (0.1.0)
- WKBridge (0.2.4)

DEPENDENCIES:
- WKBridge (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
WKBridge: 4414f22f1d9b0fbebd5284c9217402aca20b151c
WKBridge: 83fb8c2cb727c8f570c37021b84580abe495a6f4

PODFILE CHECKSUM: cb31850da9a8f81618635069a11db6c7af8ac7b9

COCOAPODS: 1.2.0.beta.1
COCOAPODS: 1.2.1
15 changes: 8 additions & 7 deletions Example/Pods/Local Podspecs/WKBridge.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

302 changes: 160 additions & 142 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/WKBridge/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/WKBridge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
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";
showEnvVarsInLog = 0;
};
865A2A1393F77C6A76976303 /* [CP] Copy Pods Resources */ = {
Expand Down
6 changes: 3 additions & 3 deletions WKBridge/Classes/Bridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ open class Bridge: NSObject {
/// Closure when js send message to native
/// - Parameter parameters: js parameters
/// - Parameter callback: callback func
public typealias Handler = (_ parameters: [String: Any]?, _ callback: Callback) -> Void
public typealias Handler = (_ parameters: [String: Any]?, _ callback: @escaping Callback) -> Void

private(set) var handlers = [String: Handler]()

Expand Down Expand Up @@ -149,9 +149,9 @@ extension Bridge: WKScriptMessageHandler {
print(body)
}
if let callbackID = (body[MessageKey.callback] as? NSNumber) {
handler(body[MessageKey.parameters] as? [String: Any]) { (results) in
handler(body[MessageKey.parameters] as? [String: Any]) { [weak self] (results) in
// Do Nothing
guard let webView = webView else { return }
guard let webView = self?.webView else { return }
webView.st_dispatchBridgeEvent(Bridge.callbackEventName, parameters: ["id": callbackID], results: results, completionHandler: nil)
}
} else {
Expand Down