AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Swift to java converter8/30/2023 ![]() It's worth noting that, like other transpilers for app development, Gryphon is best suited for translating platform-independent logic code. ![]() This depends on your application - how similar app's architecture is to its Android counterpart, how often your code uses Swift features unsupported by Gryphon, etc. ![]() Yes - but it will need some adaptations (though probably less than your average multiplatform framework). Can Gryphon help translate my existing iOS app? If you have any difficulties with Swift 5.2, please let us know. You can find out which Swift version your Gryphon binary uses by running gryphon -version.ĭue to some technical limitations, only Swift 5.3, 5.4 and 5.5 are being tested in the latest versions of Gryphon. ![]() It will use whatever Swift version was used to build it, so if you build the Gryphon binary using Swift 5.5 then that's the version it will assume all your Swift code is in. Gryphon currently supports Swift 5.2 to 5.5. What Swift versions can Gryphon translate? Some Swift features are just waiting to be implemented, while others can't be translated to Kotlin and may never be supported. It is currently capable of translating many of the main features one might expect - classes, structs, enums, closures, extensions, protocols, etc - enough that it currently translates around 97% of a version of its own codebase (the other 3% are platform-specific files). Gryphon's support for Swift features is constantly evolving. Can I translate anything written in Swift? Gryphon attempts to find a "reasonably understandable Kotlin" middle ground somewhere between "machine-code-like Kotlin" and "perfectly idiomatic Kotlin". This is done within some realistic constraints: the priority is that the translated code has to behave correctly, for instance. As a rule, if you understand the input Swift code, you should also be able to understand the translated Kotlin code - if you don't, feel free to file a bug report. One of Gryphon's main goals is to make sure translated code can be understood by human beings. Will I be able to understand the translated code? It's still possible technically to generate Kotlin code that doesn't compile - for instance, if you try to translate unsupported Swift features, or if there's a bug - but as a rule, you should be able to translate, compile and run supported code without the need for post-translation edits. Gryphon's output code is meant to behave just like the input code that created it. Can I compile and run the translated code or do I need to fix it first? It was especially designed to enable app developers to translate platform-independent parts of their iOS apps into code they can use in their Android apps. Gryphon is a command line application that can translate Swift code into Kotlin code. There are also more advanced guides on using collections, using translation comments, and using templates □ Frequently asked questions What is Gryphon? It covers the basic information needed to begin using Gryphon, whether you want to translate command line programs, translate a new iOS app to Android, or add Gryphon to an existing app. $ docker run -it -rm -privileged -v /absolute/path/to/current/directory/:/app/Gryphon gryphonĬheck out the Tutorial to get started. Use Homebrew to install Gryphon and its dependencies automatically: You can also check out the currently supported translations for the Swift standard library here. If that's the case, feel free to report a new issue on GitHub. However, users often find new bugs to be fixed. This means the main systems and ideas have already been implemented - for instance, it's been translating a complete version of its own codebase for a while now. Use special comments and templates to customize your Kotlin translation, and use any platform-specific features you want - even in translated source files. Translate your iOS code to Android, compile the Android app, and see Kotlin's errors and warnings in the Swift lines that originated them - all without leaving Xcode. Translated Kotlin files work the same as the Swift files they came from. Stop using Gryphon whenever you want - you'll still be able to read and understand your Kotlin code, even the computer-generated parts. It was created to enable mobile app developers to share parts of an iOS app's codebase with Android. Gryphon is a program that translates Swift code into Kotlin code. ![]() Gryphon is looking for new maintainers! If you're interested in helping out or just want to check out our progress, head over to the GitHub forum post. ![]()
0 Comments
Read More
Leave a Reply. |