You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
This run starts from the [feat/turbomodule-swift](https://github.com/react-native-community/RNNewArchitectureLibraries/tree/feat/turbomodule-swift) branch.
4
4
Start from there up to the `[TurboModule] Test the swift Turbomodule` section. Then, follow the steps below to move your logic to a Swift implementation file.
5
5
6
+
This guide will teach how to implement a function call in the Native platform that produces a result in Javascript as an asynchronous event, instead of using a promise or a synchronous call. It also show how to set up properly the delegate pattern between Swift and Objective-C++, in case the Swift implementation needs some state.
7
+
6
8
## Table of contents
7
9
8
10
*[[Codegen] Update Codegen Specs](#codegen)
@@ -12,7 +14,7 @@ Start from there up to the `[TurboModule] Test the swift Turbomodule` section. T
### <aname="swift-logic" />[[Swift] Implement the Swift logic]()
34
36
37
+
**Note:** This will be fixed in the stable release of 0.71
38
+
39
+
### <aname="swift-logic" />[[Swift] Implement the Swift logic](https://github.com/react-native-community/RNNewArchitectureLibraries/commit/b73b48b7fbae5a78629466a46ed0208e6ac26308)
40
+
35
41
1. Open the `calculator/ios/Calculator.swift` file
36
42
2. Add the following `CalculatorDelegate` protocol in it. This protocol will be implemented by the Objective-C++ class to provide the send event method to the Swift implementation
37
43
```swift
@@ -86,7 +92,7 @@ extension Calculator {
86
92
}
87
93
```
88
94
89
-
### <aname="objc-logic" />[[Obj-C++] Implement the Objective-C++ logic]()
95
+
### <aname="objc-logic" />[[Obj-C++] Implement the Objective-C++ logic](https://github.com/react-native-community/RNNewArchitectureLibraries/commit/2543c47a4e1957d9628341b3e877ae60b322d977)
90
96
91
97
1. Open the header file `calculator/ios/RNCalculator.h` and make it extend `RCTEventEmitter`
92
98
```diff
@@ -160,7 +166,7 @@ extension Calculator {
160
166
}
161
167
```
162
168
163
-
### <aname="test" />[[Test] Test the new feature in your app]()
169
+
### <aname="test" />[[Test] Test the new feature in your app](https://github.com/react-native-community/RNNewArchitectureLibraries/commit/a2682b156a29d254cec8c6adee0cd7e079c4501b)
0 commit comments