Hello , question about KMM and swift framework. I wanted to integrate it in Shared module. Doing so by docs https://kotlinlang.org/docsmultiplatform-mobile-ios-dependencies.html results in error module not found. Did someone had the same and how to resolve this? Maybe someone have Open source sample ?
h
hfhbd
10/13/2022, 2:54 PM
What do you mean with
I want to integrate it
? Do you want to use a Swift framework in Kotlin?
n
Natalia
10/13/2022, 2:54 PM
Yes
h
hfhbd
10/13/2022, 2:58 PM
Unfortunately, you can't use Swift from Kotlin. Kotlin only supports Objective-C. You can use Kotlin from Swift because the Kotlin compiler exports your Kotlin code to Objective-C and Swift is able to import Objective-C.
But if the Swift framework also exports Objective-C, you could import this Objective-C lib in Kotlin.
n
Natalia
10/13/2022, 3:01 PM
So, if it will export Objective-C(A Swift library can be used in Kotlin code if its API is exported to Objective-C with @objc.), I should not get this : fatal error: module 'MyFramework' not found?