This project demonstrates how to use a CocoaPods dependency in a Kotlin Multiplatform (KMP) project, including how to bridge a pure Swift library into Kotlin code using a custom CocoaPods wrapper. It also includes an iOS app to showcase the integration in action.
kotlin-library
– A Kotlin Multiplatform module with acocoapods
section that includes a dependency on the local Swift podAppleLibrary
.AppleLibrary
– A Swift CocoaPods library created withpod lib create AppleLibrary
. It wraps the pure Swift librarySwiftyJSON
, acting as a bridge to expose it to Kotlin code.iosApp
– A sample iOS app that demonstrates how the shared Kotlin code and the bridged Swift functionality can be used together.
Importing of this project to IntelliJ IDEA provides features like code-completion from these dependencies, highlighting and others