I a currently making a Firebase-based SWIFT project with Xcode. I have looked around for any swift to java conversions, but I found nothing good or anything that could help me in any way, until I found j2objc. I was just wondering if j2objc worked with swift, and if it works well.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "j2objc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to j2objc-discus...@googlegroups.com.
I'm using j2objc with Swift too, and I've had a similar experience as yours. The pain of having to manually add the new files to the Xcode project was solved on our side by a little Ruby script run just after the j2objc step, that uses the xcodeproj gem to add all the generated headers and source files to the target.
Similarly, an umbrella header can be easily updated from the list of generated headers. Then, you only have to add a reference to this header in the bridging header. The downside is that you will expose all your Java classes to Swift, which may not be the most optimal thing to do in terms of build time.
I do have one question, though. J2ObjC generates a lot of forward declarations for java types (eg. JavaUtilList), so you manually have to include the right Java headers in the bridging header for Swift to know about these types. Is there a way around this? How do you deal with this issue?