Custom Fabric Components that use Swift code #40
-
Hello everyone! One of our UX's is implemented using SwiftUI and interfaces with RN as a Fabric Component using codegen. Everything works flawlessly and it feels quite magical to be able to do this kind of stuff. It's really amazing! There's just a small inconvenience we're facing which is the fact that we have to adjust the umbrella header after #ifdef __cplusplus
#import "MyCustomComponentView.h"
#endif I was wondering if there's a better way to handle this? Maybe there's something we can set in the Edit: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Edit: |
Beta Was this translation helpful? Give feedback.
-
@andrestone Thanks for the question and it's amazing that you manage to make it work. As you said, there is no interop between Swift and C++ at the moment. Your approach is the one we would suggest anyway: wrapping the SwiftView into an ObjC component. However, we have not tried nor tested it. |
Beta Was this translation helpful? Give feedback.
@andrestone Thanks for the question and it's amazing that you manage to make it work.
As you said, there is no interop between Swift and C++ at the moment. Your approach is the one we would suggest anyway: wrapping the SwiftView into an ObjC component. However, we have not tried nor tested it.
We know that Swift support is important and we are analyzing what we need to do to connect Swift with the New Architecture.