hello folks đź‘‹
Let’s say I have an abstract class in Kotlin that is subclassed from Swift. This subclass is then instantiated and passed to Kotlin code.
Is there a way to get Swift’s subclass name from Kotlin?
p
Paul Woitaschek
11/25/2021, 5:17 PM
There is no reflection available. However you could add an abstract function where each class returns its own name
l
louiscad
11/25/2021, 10:20 PM
Or an abstract property (which is a technically a method)
n
Nikolay Kasyanov
11/26/2021, 8:53 AM
thanks folks, that’s exactly what I ended up doing.