Skip to content

Commit c559617

Browse files
committed
Clean up README instrutions and code
1 parent f0f9c98 commit c559617

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Just open the Xcode project (requires Xcode > 4.2) and hit run to see the exampl
1111
Usage
1212
-----
1313

14-
See WebViewJavascriptBridge/AppDelegate.* and WebViewJavascriptBridge/ExampleWebViewJavascriptBridgeDelegate.* for example code that works. Or, follow these steps:
14+
See ExampleAppDelegate.* for example code. To use it in your own project:
1515

1616
1) Copy `Classes/WebViewJavascriptBridge.h` and `Classes/WebViewJavascriptBridge.m` into your Xcode project
1717

1818
2) Instantiate a UIWebView, a WebViewJavascriptBridge, and set yourself as the bridge's delegate
1919

20-
#import <Foundation/Foundation.h>
20+
#import <UIKit/UIKit.h>
2121
#import "WebViewJavascriptBridge.h"
2222

2323
@interface ExampleAppDelegate : UIResponder <UIApplicationDelegate, WebViewJavascriptBridgeDelegate>
@@ -52,17 +52,16 @@ See WebViewJavascriptBridge/AppDelegate.* and WebViewJavascriptBridge/ExampleWeb
5252

5353
4) Finally, set up the javascript side of things
5454

55-
document.addEventListener('WebViewJavascriptBridgeReady', onBridgeReady, false);
56-
function onBridgeReady() {
55+
document.addEventListener('WebViewJavascriptBridgeReady', function onBridgeReady() {
5756
WebViewJavascriptBridge.setMessageHandler(function(message) {
58-
alert('Received message: ' + message);
59-
});
60-
WebViewJavascriptBridge.sendMessage('Hello from the JS scope!');
61-
}
57+
alert('Received message: ' + message)
58+
})
59+
WebViewJavascriptBridge.sendMessage('Hello from the javascript')
60+
}, false)
6261

63-
Notes
64-
-----
65-
If you're using the new ARC features, please remind yourself to add `-fno-objc-arc` as a compiler flag to the `WebViewJavascriptBridge.m` file. This will disable ARC for this specific class.
62+
ARC
63+
---
64+
If you're using ARC in your project, add `-fno-objc-arc` as a compiler flag to the `WebViewJavascriptBridge.m` file.
6665

6766
Contributors
6867
------------

0 commit comments

Comments
 (0)