Skip to content

Commit

Permalink
Added README documentation on using WKWebview
Browse files Browse the repository at this point in the history
  • Loading branch information
lokimeyburg committed Oct 15, 2014
1 parent b458d79 commit 553cf74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion Example Apps/ExampleApp-iOS/ExampleAppViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ - (void)viewWillAppear:(BOOL)animated {
if (_bridge) { return; }

#if defined(exampleSupportsWKWebKit)
NSLog(@"---------------------------------------");
WKWebView* webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds];
webView.navigationDelegate = self;
[self.view addSubview:webView];
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ To use a WebViewJavascriptBridge in your own project:
})
})

WKWebView Support (iOS 8 & OS 10.10)
------------------------------------

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`.

1) Import the header file:

#import "WKWebViewJavascriptBridge.h"

2) Instantiate WKWebViewJavascriptBridge and with a WKWebView object

WKWebViewJavascriptBridge* bridge = [WKWebViewJavascriptBridge bridgeForWebView:webView handler:^(id data, WVJBResponseCallback responseCallback) {
NSLog(@"Received message from javascript: %@", data);
responseCallback(@"Right back atcha");
}];

Contributors & Forks
--------------------
Contributors: https://github.com/marcuswestin/WebViewJavascriptBridge/graphs/contributors
Expand Down

0 comments on commit 553cf74

Please sign in to comment.