Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Kevin is Parter at Touchlab, a mobile innovation consultancy with Kotlin Multiplatform expertise.
If youâre interested in learning more, weâre hosting a live demo of the plugin on Friday, April 26, 3 PM EST. You can tune in here.
For native mobile developers using Kotlin Multiplatform, the iOS dev experience will be critical. Over the next several months at least, that will be the primary focus of Touchlabâs Kotlin R&D and our collaboration with Square.
Our first release is an Xcode Plugin for Kotlin. Once installed, Xcode will recognize Kotlin files as source files, provide keyword coloring, and most importantly, will let you interactively debug Kotlin code running in the iOS simulator.
Depending on project setup, that includes regular code as well as Kotlin unit test code. Weâll be providing info on how to run your unit tests in Xcode soon.
Live Code!
Setting up the plugin and Xcode can be a little tricky. Weâll be doing a live code session Friday 4/26 at 3pm EST. Weâll be setting up a project, demoing debug functionality, helping out some others with setup, and time permitting, checking out App Code as well. If youâd like to watch, sign up here.
If youâre planning on using the Xcode debugger and would like some live help, tick the box on the form above. Youâll need to share your screen, or at least have an open source project we can run. Weâll be picking 1 or 2 projects and attempting to configure them live.
App Code?
We are still very much fans of JetBrains tools and look forward to a fully integrated dev experience with AppCode. Check out the blog post about updated support in v2019.1. AppCode has started to ship with an interactive debugger, and we look forward to this product maturing along with Kotlin as a platform.
However, convincing iOS devs to give Kotlin MP a shot is easier with an Xcode option. This plugin is definitely not a full featured tool like IntelliJ IDEA and AppCode, but will allow iOS developers to step through and debug shared code.
Our thinking is that on many teams, iOS focused developers will start out mostly consuming Kotlin. Being able to navigate and debug in their native tools will go a long way towards interest and learning.
Xcode Plugin?
A few years back Apple shut down most plugin functionality for Xcode. However, that mostly applies to executable code that may alter output. Although the Kotlin Plugin goes in the âPluginâ folder, it does nothing prohibited by Apple, so requires no special permissions. You can simply copy the language config files and restart Xcode.
Xcode will ask if youâd like to load the bundle on first run. Youâll need to allow that.
Status
This is definitely a work in progress. There are multiple facets what will be improved upon in the future. However, once configured, this is a very useful tool. Feedback and contributions very much welcomed.
Kotlin Source
In order to set breakpoints in Kotlin code, youâll need the Kotlin source available in Xcode. For those familiar with Intellij and Android Studio, the source wonât simply âappearâ because itâs in your project folder. We need to import it into Xcode.
You can import manually, but you should make sure the files arenât copied out to the app bundle. Xcode ârecognizesâ Kotlin files, but doesnât treat them the same as Swift files, for example, by default. You will also need to refresh the Kotlin files periodically as you add/remove code.
As an alternative, we have a Gradle plugin that you can point at a source folder and an Xcode project, and itâll import Kotlin files. This plugin is very new and some planned features will likely be missed. Kotlin source for dependencies would be the most obvious. Weâd love some help with this one.
As another alternative, if using Cocoapods, itâs possible to add source_files to your podspec, but weâre just starting to experiment with this.
Next Steps
Weâll be posting more general updates soon. Subscribe to the mailing list, follow me and/or Touchlab on twitter, or come watch the live stream mentioned above.
Also come hear Justin at The Lead Dev NYC!
Kotlin Xcode Plugin was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.