Are we going to have interop with native Swift mod...
# kotlin-native
m
Are we going to have interop with native Swift modules ? You mentioned that in KotlinConf I want to know how close we are to achieve this
e
Can you, please, elaborate a bit more on what is your use-case and what is that exactly you are trying to achieve?
m
Well for now the iOS developers are moving to swift and all the new libraries are in Swift (and not exported to objective-c) so we can't use these libraries for now. Also with Swift interop we will have the ability to write SwiftUi from Kotlin/Native which will make building native components for Compose easier such as Alerts, Navigation, Sheets... We do all of that with UiKit for now even if it is kinda more tricky, but I'm afraid of deprecating it in new iOS versions. I think that you need to take this into consideration. Also SwiftUI and Swift in general are similar to Kotlin and Compose so this will make KMM developers more comfortable with Kotlin/Native for iOS whenever they need to deal with it.
j
I think the focus should be on Swift much more, both in using a Kotlin framework in Swift and being able to use Swift only frameworks in Kotlin. Objective-C is fully legacy at this point, Swift has been out many years and a lot of iOS devs barely interact with ObjC, many have never used it all.
e
Same, it's the biggest friction point I've found when proposing KMM to my iOS team, and it makes KMM look like it's not ready to be used.
i
It would be ugly hack if you tried to get Swift class to export into Objective-C
a
+ to this.
j
@itnoles the Swift class just needs to be annotated with
@objc
to be able to be used in Objective-C right?
a
While that’s true, I’d be interested to see the % of swift libraries remembering to do that
i
@Jon Bailey True
l
3rd party SDKs are increasingly Swift only, denying much of the ability to configure platform-specific almost in unison with ones from Android. In our case, we end up having to expose more of our KMP guts through the Obj-c header, making it harder for iOS engineers to explore the Kotlin module provided to them
j
also the main 1st party SDK, Foundation, is going Swift only.
s
any update on this?
m
At droidcon Berlin, Hadi said that they are working on swift interop
👍 1