Skip to content

Commit 553cf74

Browse files
committed
Added README documentation on using WKWebview
1 parent b458d79 commit 553cf74

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Example Apps/ExampleApp-iOS/ExampleAppViewController.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ - (void)viewWillAppear:(BOOL)animated {
2626
if (_bridge) { return; }
2727

2828
#if defined(exampleSupportsWKWebKit)
29-
NSLog(@"---------------------------------------");
3029
WKWebView* webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds];
3130
webView.navigationDelegate = self;
3231
[self.view addSubview:webView];

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ To use a WebViewJavascriptBridge in your own project:
7979
})
8080
})
8181

82+
WKWebView Support (iOS 8 & OS 10.10)
83+
------------------------------------
84+
85+
WebViewJavascriptBridge supports [WKWebView](http://nshipster.com/wkwebkit/) for iOS 8 and OSX Yosemite. In order to use WKWebView you need to instantiate the `WKWebViewJavascriptBridge`. The rest of the `WKWebViewJavascriptBridge` API is the same as `WebViewJavascriptBridge`.
86+
87+
1) Import the header file:
88+
89+
#import "WKWebViewJavascriptBridge.h"
90+
91+
2) Instantiate WKWebViewJavascriptBridge and with a WKWebView object
92+
93+
WKWebViewJavascriptBridge* bridge = [WKWebViewJavascriptBridge bridgeForWebView:webView handler:^(id data, WVJBResponseCallback responseCallback) {
94+
NSLog(@"Received message from javascript: %@", data);
95+
responseCallback(@"Right back atcha");
96+
}];
97+
8298
Contributors & Forks
8399
--------------------
84100
Contributors: https://github.com/marcuswestin/WebViewJavascriptBridge/graphs/contributors

0 commit comments

Comments
 (0)