https://kotlinlang.org logo
#touchlab-tools
Title
# touchlab-tools
b

brabo-hi

10/04/2023, 6:14 AM
Hello guys, can we consume xcframework in kmm ios dependecy
t

Tadeas Kriz

10/05/2023, 12:52 PM
Hi, might be better question for the JetBrains team. But xcframework is just a container with .framework in it, so if xcframework isn't supported by itself, you should be able to just load the .frameworks from it.
k

kpgalligan

10/05/2023, 1:23 PM
By
consume
, is this a local file, a cocoapods or spm dependency? You'd need to: • point cinterop at the headers (and only Objc or Swift that exports to Objc will work. Regular Swift code will not) • tell the linker about the binary Kotlin CocoaPods support should handle this directly (unless it runs into a bug, which isn't super uncommon for complex CocoaPod dependencies). It'll run cinterop and make sure the binary can be linked. I don't know of an SPM version of the same that will handle it all automatically. You can manually wire this up as well, although if you're not familiar with cinterop, it'll be a bit of a research project. Just FYI.
b

brabo-hi

10/07/2023, 5:30 PM
thanks @Tadeas Kriz @kpgalligan indeed what i am trying to consume a local file xcframework, i have it as local folder, so i will just point to headers and link the binary
@kpgalligan do you have any doc or sample on how to do that
2 Views