Deaths-Door / astroplayer-kt

AstroPlayer is an open-source media player designed for the Kotlin Multiplatform. It provides a simple API for audio playback and supports multiple media formats while also providing an Jetpack Compose UI.
https://deaths-door.github.io/astroplayer-kt/
7 stars 1 forks source link

Define iOS Source Set `AstroPlayer` Using Native Swift Implementation #7

Closed markst closed 1 month ago

markst commented 2 months ago

@Deaths-Door, I'd love to hear your thoughts on this approach.

Instead of defining the native iOS AstroPlayer component in Kotlin using interoperability, this demonstrates how we can use a plugin like swift-klib-plugin to inject Swift code into the shared module.

One benefit is that it allows the repository to work natively on iOS. By defining our Package.swift in the root, we're able to independently work on the audio component:

Swift Integration

This approach means one repository can serve as an Android package, a KMP package, and a native Swift package:

Deaths-Door commented 2 months ago

Instead of defining the native iOS AstroPlayer component in Kotlin using interoperability, this demonstrates how we can use a plugin like swift-klib-plugin to inject Swift code into the shared module.

I don't have any experience using Apple technologies like Swift or even a Mac , and hence I can not come to an education thought , but the approach you proposed seems sound.

markst commented 1 month ago

Created my own working repo: https://github.com/markst/radioplayer-kt Also tagging this PR: https://github.com/PaGr0m/kotlin-spm-plugin/pull/7