what objects can you transfer back and fourth betw...
# kotlin-native
s
what objects can you transfer back and fourth between kotlin and swift via the bridge? Is it only a subset of objects, or does anything work?
o
Objects that make sense in both worlds usually could be transferred, but this question better be more specifics, if you need more specific answer.
a
You just need to return it in the function, and generate an iOS framework from it. And inspect the obj-c definition. Sometimes it has a great bridge, sometimes you need to implement an interface. It depends.
s
If I have an immutable data class from the kotlin framework, will I have a problem transferring that object to swift?
s
In most cases you won’t have any problems transferring Kotlin object to Swift. @olonho says about very special objects, e.g. object which inherits
Set
and
List
interfaces at the same time (because Objective-C object can’t be
NSArray
and
NSSet
at the same time).
s
I see. makes sense.