Definition of Fabric Native Components using Swift #146
-
After implementing a turbo native module using swift (#143), I am now trying to implement a Fabric Native Component using Swift. Unfortunately, RNNewArchitectureLibraries does not include an example of a Fabric Native Componente written in Swift. That's why I wanted to ask if this is possible before digging deeper into this. I already tried to implement the Using the legacy native components I was able to code my custom view class using Swift and just instantiate a new instance in the Is there any other way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @flokol120! Unfortunately, currently it is not possible to implement a Fabric Component using Swift easily. There could be wayt to do that, by adding an ObjectiveC++ layer in between, but we never tested it and the process could be cumbersome and introduce subtle bugs, so we are not advising this, nor working on that right now. We have ideas on how to simplify the setup to enable using Swift to create Fabric Components, but currently is not our highest priority. :( |
Beta Was this translation helpful? Give feedback.
-
hi folks, what is the latest on this can we use fabric with swift now using the new architecture ? |
Beta Was this translation helpful? Give feedback.
Hi @flokol120! Unfortunately, currently it is not possible to implement a Fabric Component using Swift easily.
The Fabric interfaces relies a lot on C++ code which is not usable for Swift as they not interop well enough for our purposes.
There could be wayt to do that, by adding an ObjectiveC++ layer in between, but we never tested it and the process could be cumbersome and introduce subtle bugs, so we are not advising this, nor working on that right now.
We have ideas on how to simplify the setup to enable using Swift to create Fabric Components, but currently is not our highest priority. :(