Skip to content

Commit ab506e8

Browse files
Update README
1 parent dd3bc64 commit ab506e8

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

JavaScriptBridge.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "JavaScriptBridge"
33
s.version = "0.0.1"
4-
s.summary = "JavaScriptBridge provides the way to write iOS apps with JavaScript."
4+
s.summary = "Write iOS apps in Javascript! JavaScriptBridge provides the way to write iOS apps with JavaScript."
55
s.homepage = "https://github.com/kishikawakatsumi/JavaScriptBridge"
66
s.license = 'MIT'
77
s.author = { "kishikawa katsumi" => "[email protected]" }

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@ JSContext *context = [JSBScriptingSupport globalContext];
2727
];
2828
```
2929

30+
Retrieve the `JSContext` instance from `JSBScriptingSupport`.
31+
The context includes a lot of system classes that has been `JSExports` adopted.
32+
```objc
33+
JSContext *context = [JSBScriptingSupport globalContext];
34+
```
35+
36+
Add `JSExports` adopted classes each framework if needed.
37+
By default, `Foundation`, `UIKit`, `QuartzCore` frameworks are included.
38+
```objc
39+
[context addScriptingSupport:@"MapKit"];
40+
[context addScriptingSupport:@"MessageUI"];
41+
```
42+
43+
It is ready to use, writing appliction code and evaluate in JavaScript.
44+
```
45+
[context evaluateScript:
46+
@"var window = UIWindow.new();"
47+
@"window.frame = UIScreen.mainScreen().bounds;"
48+
@"window.backgroundColor = UIColor.whiteColor();"
49+
@"window.makeKeyAndVisible();"
50+
];
51+
```
52+
3053
### Syntax / Naming conventions
3154

3255
**Class name**

0 commit comments

Comments
 (0)