https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

Prateek Grover

09/30/2020, 1:22 PM
anyone sharing model classes in KN between android and iOS? Specifically for iOS, if we do this, there is a huge limitation where even if the object is created in Swift (model class resides in KN), we cant use that object from multiple threads How are you guys working around it? Freezing?
s

streetsofboston

09/30/2020, 4:02 PM
For sharing mutable (or late/lazily-created) state/data for iOS (native) from the shared Kotlin code, we use TouchLab's AtomicReference classes.
1
s

spierce7

09/30/2020, 6:15 PM
In most cases you don’t need to store mutable data, and so freezing works just fine