Thread
#multiplatform
    b

    Brian

    3 years ago
    Hey! I'm trying to access types and methods of the stdlib (specifically:
    Sequence
    ) from Swift. It seems, that the generated framework headers only include definitions for my code but misses a lot from the stdlib. So there actually is the compiled
    KotlinSequence
    accessible but all the factory and extension functions are not -- which renders it pretty useless. Is there a way, to make some or all types and methods available in a compiled native xcode framework? Any hints are much appreciated! See also my question on stackoverflow: https://stackoverflow.com/questions/53103956/access-kotlin-standard-library-from-swift
    s

    svyatoslav.scherbina

    3 years ago
    The only option available currently for extensions and factories is to add simple wrappers for these functions to your module, e.g.
    fun <T : Any> generateSequence(nextFunction: () -> T?): Sequence<T> = kotlin.sequences.generateSequence(nextFunction)
    b

    Brian

    3 years ago
    Oh ok. Actually that’s what I started with. But that felt like too much boilerplate to write
    Wouldn’t it be possible, somehow, to add definitions to the headers? Maybe via a Gradle config?
    … or maybe let me ask my last question differently 😉 : is this something that will be improved in the future?
    s

    svyatoslav.scherbina

    3 years ago
    We have no specific plans for improving experience in this particular case with
    Sequence
    .