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

Hannes

12/23/2019, 9:48 PM
Hi there, any hint how to call an
object
from iOS side? Let's say I have in commonMain a
Copy code
object Foo
How can i call
Foo
from iOS side? If I try to use Foo directly I actually somehow access the Type, but not the singleton instance. Any idea?
k

kpgalligan

12/23/2019, 10:55 PM
Foo()
s

spierce7

12/24/2019, 12:40 AM
Calling
Foo()
returns the same instance for Kotlin
object
. Even though it looks like you are calling a constructor, you are really just accessing the singleton. You can confirm this by testing that
Foo() === Foo()
h

Hannes

12/24/2019, 10:04 AM
thanks!