Skip to content

Commit 5d1b1cf

Browse files
committed
Added readme for Hemlig
1 parent 52b9134 commit 5d1b1cf

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ WebViewJavascriptBridge is used by a range of companies and projects. This list
2020
- JD Media's [鼎盛中华](https://itunes.apple.com/us/app/ding-sheng-zhong-hua/id537273940?mt=8)
2121
- Dojo4's [Imbed](http://dojo4.github.io/imbed/)
2222
- [CareZone](https://carezone.com)
23+
- [Hemlig](http://www.hemlig.co)
2324

2425
Setup & Examples (iOS & OSX)
2526
----------------------------
@@ -31,7 +32,7 @@ To use a WebViewJavascriptBridge in your own project:
3132
1) Drag the `WebViewJavascriptBridge` folder into your project.
3233

3334
- In the dialog that appears, uncheck "Copy items into destination group's folder" and select "Create groups for any folders"
34-
35+
3536
2) Import the header file:
3637

3738
#import "WebViewJavascriptBridge.h"
@@ -52,7 +53,7 @@ To use a WebViewJavascriptBridge in your own project:
5253
}];
5354

5455
4) Finally, set up the javascript side:
55-
56+
5657
function connectWebViewJavascriptBridge(callback) {
5758
if (window.WebViewJavascriptBridge) {
5859
callback(WebViewJavascriptBridge)
@@ -62,13 +63,13 @@ To use a WebViewJavascriptBridge in your own project:
6263
}, false)
6364
}
6465
}
65-
66+
6667
connectWebViewJavascriptBridge(function(bridge) {
67-
68+
6869
/* Init your app here */
6970

7071
bridge.init(function(message, responseCallback) {
71-
alert('Received message: ' + message)
72+
alert('Received message: ' + message)
7273
if (responseCallback) {
7374
responseCallback("Right back atcha")
7475
}
@@ -100,14 +101,14 @@ The `WVJBResponseCallback` will not be `nil` if the javascript expects a respons
100101
Optionally, pass in `webViewDelegate:(UIWebViewDelegate*)webViewDelegate` if you need to respond to the [web view's lifecycle events](http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html).
101102

102103
Example:
103-
104+
104105
[WebViewJavascriptBridge bridgeForWebView:webView handler:^(id data, WVJBResponseCallback responseCallback) {
105106
NSLog(@"Received message from javascript: %@", data);
106107
if (responseCallback) {
107108
responseCallback(@"Right back atcha");
108109
}
109110
}]
110-
111+
111112
[WebViewJavascriptBridge bridgeForWebView:webView webViewDelegate:self handler:^(id data, WVJBResponseCallback responseCallback) { /* ... */ }];
112113

113114
##### `[bridge send:(id)data]`

0 commit comments

Comments
 (0)