Skip to content

Commit 8dd4a91

Browse files
Update README
1 parent 7778fc0 commit 8dd4a91

2 files changed

Lines changed: 30 additions & 3 deletions

File tree

JavaScriptBridge.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Pod::Spec.new do |s|
55
s.homepage = "https://github.com/kishikawakatsumi/JavaScriptBridge"
66
s.license = 'MIT'
77
s.author = { "kishikawa katsumi" => "[email protected]" }
8-
s.source = { :git => "https://github.com/kishikawakatsumi/JavaScriptBridge.git", :tag => s.version.to_s }
8+
s.source = { :git => "https://github.com/kishikawakatsumi/JavaScriptBridge.git", :tag => "v#{s.version.to_s}" }
99

1010
s.platform = :ios, '7.0'
1111
s.ios.deployment_target = '7.0'

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ JavaScriptBridge provides the way to write iOS apps with JavaScript.
88

99
## Usage
1010

11+
### Naming conventions
12+
13+
**Class name**
14+
- Same as Objectige-C
15+
16+
**Variable declaration**
17+
- Get rid of type instead use `var`
18+
19+
**Invoking method
20+
- Use dot syntax
21+
- All colons are removed from the selector
22+
- Any lowercase letter that had followed a colon will be capitalized
23+
24+
25+
**Example**
26+
27+
```objc
28+
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
29+
```
30+
31+
```javascript
32+
var window = UIWindow.alloc().initWithFrame(UIScreen.mainScreen().bounds);
33+
```
34+
1135
###Hello world on JavaScriptBridge
1236

1337
This is the most simple way.
@@ -69,7 +93,9 @@ You can define custom class in JavaScript.
6993
It is needs to intaract system provided framework.
7094
7195
```javascript
72-
var MainViewController = JSB.define('MainViewController : UITableViewController', {
96+
var MainViewController = JSB.define('MainViewController : UITableViewController <UITableviewDataSource, UITableviewDelegate>', // Declaration
97+
// Instance Method Definitions
98+
{
7399
viewDidLoad: function() {
74100
self.navigationItem.title = 'UICatalog';
75101
},
@@ -112,7 +138,8 @@ JSB.exports = MainViewController;
112138
```
113139
114140
## Requirements
115-
**iOS 7 or later**
141+
- **iOS 7 or later**
142+
- JavaScriptCore.framework
116143
117144
## Installation
118145

0 commit comments

Comments
 (0)