Thread
#multiplatform
    r

    robjperez

    1 year ago
    Hi there!. I’m having issues when doing iOS with KMM. My main problem is how to handle the callbacks in the form of completion blocks. Some iOS callbacks happen in a different thread on which the function is called. When this happen, the lambda that serves as completion block cannot be called because it was created in a different thread. I tried to freeze the lambda, and although it works, then the problem is that the lambda cannot access almost anything because it would freeze it as well. Which is the best way to deal with these issues? Thanks!!
    a

    ahmedre

    1 year ago
    i think you’ll find the 2 articles that are part of this set to be useful - https://dev.to/touchlab/kotlin-coroutines-and-swift-revisited-j5h