Hey guys, trying to create Rx bindings for iOS/And...
# kotlin-native
a
Hey guys, trying to create Rx bindings for iOS/Android. How is it possible to call custom Swift code from Kotlin(trying to call my own custom Swift classes with RxSwift inside)? Couldn't find any samples of calling custom Swift code from Kotlin, it is stated that you can do it using the @objc annotation and C-interop... Any help/info would be appreciated
k
I don’t want to dissuade your effort, but you’re going to have difficulty with threading and state. If some kotlin leaves “kotlin” and goes into swift, then attempts to return to kotlin on a different thread, it’ll fail.
a
😓
Is there something I can read about this to understand more deeply?

https://www.youtube.com/watch?v=nw6YTfEyfO0

a
Thanks a lot!
k
You’re welcome! The last one is the definitive source. The first 2 are my blog posts attempting to unpack that info.
Also, concurrency and reactive stuff in Droidcon sample app:

https://www.youtube.com/watch?v=yhvsKlxPZPQ

super, super basic pub/sub listening to sqldelight and “pushing” db updates to ui thread
And swift
a
@kpgalligan so I see you're in to multiplatform a lot. What's your favorite way of performing async operations?
And here

https://youtu.be/nw6YTfEyfO0?t=2384

, the question about shared cache, where Nikolay talks about getting and putting an object. I tried to do as follows and since the objects are frozen, I can't mutate anything. I don't understand where can I store the updated object.