Hi. Can anyone help me with extension function from Kotlin to swift? Seems like I’m not able to access the extension from Swift
m
Michal Klimczak
05/20/2021, 6:58 PM
Afair you can make an extensions function on a kotlin type as long as it doesn't have a generic type parameter.
The reason is the lack of swift interoperability. Your kotlin types are only as good as objc types. And they are pretty bad ;)
l
louiscad
05/24/2021, 9:16 AM
Extension functions for interfaces aren't visible in Swift. One workaround is to change them to abstract classes, or use a top level function instead of an extension.