https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
u

ursus

02/19/2023, 3:21 PM
Is it possible to navigate to the kotlin source from a ios callsite? (Trying to figure out what the dev ux for ios side will be)
m

MarkRS

02/19/2023, 3:27 PM
Yes. TouchLab have a (free) XCode plugin that facilitates this (if I've understood correctly).
u

ursus

02/19/2023, 3:28 PM
understood me or what the plugin does 😄
m

MarkRS

02/19/2023, 3:29 PM
You🤔
u

ursus

02/19/2023, 3:33 PM
I just want navigation back to the kotlin source. Now if I go into the implementation, it obviously just takes me to the obj source, which will be impossible to read when using coroutines etc. therefore I'd have swap back to Android studio, and then open the source manually / search kotlin file
also, what's interesting, xcode takes me to some objc header thing while AppCode takes me to "nicer" swift source
shared.h
vs
shared.swift
d

Daniel Seither

02/20/2023, 9:22 AM
I’m using the Xcode Kotlin plugin that Mark mentioned. With that plugin, you’ll still not land at the Kotlin source but in the Objective-C header for the Kotlin framework, but after adding the Kotlin source tree to your iOS project as a folder reference, you can at least Cmd+Shift+O to open the relevant Kotlin source file if you remember its name (or navigate through the Kotlin source tree within Xcode if you don’t). Once you’re in the Kotlin source, you can set breakpoints etc., which is the no. 1 feature of the plugin for me. If instead you’re fine with the header info but want it in a more readable form in Swift, you can switch to a generated Swift interface:
8 Views