Dev UX of switching IDEs (AS, XCode) back and fort...
# multiplatform
u
Dev UX of switching IDEs (AS, XCode) back and forth is not great & Fleet is years away tbh. Should I jump all the way to CMP -- and therefore have basically zero interface between kotlin and swift & this way I can stay in a single IDE where navigation & everything works. (?) (But with CMP we're kind of full circle from "share code & have native uis") Opinions?
j
Stick with 2 IDE's until Fleet is stable. They just announced 2025 roadmap for it, it seems promising in near future to be using a single IDE. Using CMP just because you want a single IDE is not a good use case for CMP really, just my opinion. If you architect your app properly, meaning use Xcode for building SwiftUI views only and Android Studio for everything else, shared and Android app...you will be mostly in Android Studio until you need to wire up the SwiftUI side of things.
u
So meanwhile if you want to navigate into a function, you copy paste the name. switch to AS (from xcode), and search the function by name?
j
You can navigate from Xcode into the common KMP functions, you need to use a Workspace instead of a project. So instead of using iOSapp.xcodeproj make a new workspace, iOSapp.xcworkspace. You then drag the entire shared folder into this workspace and make sure you choose 'Create folder references for any added folders'. Now your setup to browse the code and can even go one step further and debug Kotlin shared code from Xcode if you want, which I highly recommend, as you can step thru line by line and even see the KMP instance variables in memory during any breakpoint nicely. Use this link and install xcode-kotlin plugin and your set. https://github.com/touchlab/xcode-kotlin
u
wait..so you can cmd click into a function in xcode and it takes you to kotlin source? - or the generated objc code?
btw the KMP IDE is based on Fleet (?). I don't really understand this move, isn' fleet supposed to be the "final" IDE, as to avoid all those 20 dedicated IDEs they have based on intellij?
j
Actually, i'm not 100% sure navigate to definition works from Xcode, I know that debugging Kotlin from Xcode works well. Sometimes Xcode Jump to definition doesn't work at all for me and I just tried it not working. Yea, I thought Fleet was the official KMP IDE, not sure why they say based, maybe based is used because Fleet will never come out and the end result will have started from Fleet code base and released as something else.
u
just to clarify, xcode will actually navigate to kotlin source?
or are there bugs and it doesnt work reliably vs never working by design
j
I'll keep trying but no Xcode doesn't seem to navigate directly to the Kotlin code instead it will only show you the bridged obj-c generated code. I can only view the Kotlin code when debugging from Xcode.
btw...what doesn't work reliably for me is Xcode navigating to Swift code reliably so I thought it was same issue w/ Kotlin code but isn't. Makes sense Xcode would show the objective c bridged code anyways. Someone could easily make an Xcode plugin to navigate to the Kotlin code though, I just don't have that time or I would do it or just wait for JetBrains new stuff.
u
I’m surprised there are xcdoe plugins, afaik its not a thing