-
Is They seem to work just fine in JavaScript and Java output. Swift just ignores them. Not that it matters, but if they were working it also appears that the Any ideas on a way to inline language/platform specific code? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
This feature is not going away. Yesterday's change was about removing uses of It works for Swift and there's a test for it:
Could you show your code? |
Beta Was this translation helpful? Give feedback.
-
Which results in a compiler error If the native block is in a function scope it does appear to work, but I need it more for top-level. Right now I just create a wrapper for the transpiled swift so I can use it on the objc side, but it would be nice if I could add that decorator. I know it's a very specific use case though. Looks like top-level native blocks don't generate for swift.
results in nothing in the swift output but it is added to Java/JavaScript. |
Beta Was this translation helpful? Give feedback.
-
There were two issues:
Fixed both. The latter with a new syntax:
"git pull" cito and rebuild. Top-level natives are meant for things such as imports and helper routines. That's why they are emitted at the top of the target file. This won't work if you have many classes. |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into that and getting it fixed. This should be enough for my use case. I thought about outputting C or C++ and using it from Objective-C, but I wanted there to be one import in my project (a swift package) instead of two and I am trying to deprecate the Objective-C side anyways. |
Beta Was this translation helpful? Give feedback.
-
Looks like this doesn't quite do what I expected. It does insert the native block in Swift, however it throws it at the import level which makes it useless in this context. I end up with this. Toplevel native blocks that keep their position would be a nice feature. I can also see a use case for declaring specific data structures. For example it would be nice to be able to specify a struct for Swift instead of always having classes. |
Beta Was this translation helpful? Give feedback.
There were two issues:
Fixed both. The latter with a new syntax:
"git pull" cito and rebuild.
Top-level natives are meant for things such as imports and helper routines. That's why they are emitted at the top of the target file. This won't work if you have many classes.