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

Hauke Radtki

12/06/2019, 2:25 PM
Are default parameter values not supported in swift/ios interop?
class Foo(val ref: () -> Long = ::defaultReference)
does not allow Foo to be instantiated in iOS without specifying a value for
ref
b

basher

12/06/2019, 2:32 PM
Nope. It's a Swift feature, and that interop works via Obj-C, which doesn't have that language feature
h

Hauke Radtki

12/06/2019, 2:34 PM
Thanks for clearifying. This probably should go into the interop documentation. There is no reference to default values.
b

basher

12/06/2019, 2:34 PM
I think the interop docs do discuss that it works via Obj-C
h

Hauke Radtki

12/06/2019, 2:35 PM
That it does, but as a person like me, who just creates a library for our iOS developers to consume this is not obvious
9 Views