Skip to content

Commit 941b42d

Browse files
committed
Update README.md
1 parent 222df19 commit 941b42d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Calling native code from Javascript in iOS likes JavascriptInterface in Android.
66
- Swift 3
77
- iOS8+
88

9+
(based on WKJavaScriptController 1.1.0+)
10+
911
## Installation
1012
This library is distributed by [CocoaPods](https://cocoapods.org).
1113

@@ -38,6 +40,7 @@ $ pod install
3840
import WKJavaScriptController
3941

4042
// Create protocol.
43+
// '@objc' keyword is required. because method call is based on ObjC.
4144
@objc protocol JavaScriptInterface {
4245
func onSubmit(_ dictonary: [String: AnyObject])
4346
func onSubmit(_ email: String, firstName: String, lastName: String, address1: String, address2: String, zipCode: JSInt, phoneNumber: String)
@@ -92,4 +95,11 @@ native.onSubmit({
9295
'last_name': 'Ahn',
9396
'mail': 'davin.ahn@ridi.com',
9497
});
95-
```
98+
```
99+
100+
## Limitations
101+
- Can not receive native return in JavaScript.
102+
- Method argument length is up to 10.
103+
- Allowed types for argument types are NSNumber, NSString, NSDate, NSArray, NSDictionary, and NSNull(If pass undefined in JavaScript).
104+
- If Value Types of Swift(Bool, Int32, Int, Float, Double, ...) used in argument is not wrapped in NSArray or NSDictionary, then it must be replaced with JSBool, JSInt or JSFloat.
105+
(In ObjC, Value types of Swift is replaced by NSNumber.)

0 commit comments

Comments
 (0)