Hi! I know that using cocoapods I can integrate in...
# multiplatform
i
Hi! I know that using cocoapods I can integrate in kotlin 3rd party libraries via pod like:
Copy code
cocoapods {
        version = "1.0.0"
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
            isStatic = true
        }
        extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"

        pod("FirebaseAnalytics") {
            version = "~> 10.13"
        }
    }
But what about integrating them and then exporting as XCFramework like this:?
Copy code
val xcf = XCFramework()
listOf(
    iosX64(),
    iosArm64(),
    iosSimulatorArm64()
).forEach {
    it.binaries.framework {
        baseName = "shared"
        xcf.add(this)
        isStatic = true

    }
}
point is I don't want to integrate the shared module via pod, because I don't want pods in my final iosApp, is it achiveable? Can I add dependencies also with the XCFramework? It is also related to the previous message
p
You can, you can use SPM for doing so. However, you won't have access to the swift code or objective-c code in the 3rd party library automatically. You will have to create wrappers and bridge them from swift to kotlin
i
Right, the aim of the question was like adding them in a simple way(as we do with cocoapods in build.gradle) and still use it without wrappers in the kotlin code
p
Gotcha, I haven't seen anything similar yet.
i
I imagined, i guess with the speed of improvement we're seeing soon there will be a way, also because cocoapods integration in the kotlin environment is limited to objc pods and swift pods are not supported (at least yet) Thanks for your answers
👍 1