File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class ViewController: UIViewController {
13
13
}
14
14
```
15
15
16
- DSBridge-Swift does not rely on Objective-C runtime. Thus you can declare your interface with pure Swift types, with the bundled macro ` Exposed ` :
16
+ DSBridge-Swift does not rely on Objective-C runtime. Thus you can declare your interface with pure Swift types:
17
17
``` swift
18
18
19
19
import Foundation
@@ -27,9 +27,9 @@ class MyInterface {
27
27
func localMethod ()
28
28
}
29
29
```
30
- Add ` unexposed ` annotation to any function you don't want to expose, .
30
+ Mark your interface ` @Exposed ` and that's it. Add ` @ unexposed` annotation to any function you don't want to expose.
31
31
32
- You can also declare your it with a struct. Or, even further, an enum!
32
+ If you don't need to declare it as a class, why not use a struct? Or, even further, an enum!
33
33
``` swift
34
34
@Exposed
35
35
enum EnumInterface {
@@ -77,7 +77,7 @@ bridge.call('asyncStyledFunction', function(v) { console.log(v) });
77
77
// ""
78
78
// Async response
79
79
```
80
- As you can see, there is a immediate empty return . The response sent by us is printed by the ` function ` .
80
+ As you can see, there is a empty string returned . The response we sent in the interface is printed by the ` function ` .
81
81
82
82
OK, we send async response with the completion in its first parameter. What does the second parameter, the ` Bool ` do then?
83
83
You can’t perform that action at this time.
0 commit comments