Thread
#multiplatform
    Trey

    Trey

    2 months ago
    I have an existing project that we are hoping to switch to use KMP. We have a lot of complex swift code that we would like to include in the shared component. However, rewriting all of that Swift code would be time consuming. The Swift code does stuff like play buffered audio as it is streamed across the network. Is there a trick to reusing that Swift code easily? How have others migrated Swift code into a KMP world?
    Landry Norris

    Landry Norris

    2 months ago
    Kotlin/Native has Obj-C support, so if you mark a Swift class or function with the objc annotation, you can use it from Kotlin. This can allow you to migrate one component at a time.
    Note that objc annotation doesn’t work for swift-only features, so no structs.